home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / wordproc / elvb18x2.arj / ELVISMAN.TXT < prev    next >
Text File  |  1993-11-30  |  201KB  |  6,271 lines

  1.  
  2.  
  3.   ::      #######                                      ::
  4.   :::     #        #       #    #     #     ####      :::
  5.   ::::    #        #       #    #     #    #         ::::
  6.   :::::   #####    #       #    #     #     ####    :::::
  7.   ::::    #        #       #    #     #         #    ::::
  8.   :::     #        #        #  #      #    #    #     :::
  9.   ::      #######  ######    ##       #     ####       ::
  10.  
  11.                     - a clone of vi/ex -
  12.                      version 1.8c-beta
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.    Hurry down doomsday, the bugs are taking over! - E.C.
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43. Author:  Steve Kirkendall
  44.          14407 SW Teal Blvd., Apt C
  45.          Beaverton, OR 97005
  46.  
  47. E-Mail:  kirkenda@cs.pdx.edu
  48.  
  49. Phone:   (503) 643-6980
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.                      November 30, 1993
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.                      Table of Contents
  73.  
  74.  
  75.  
  76.  
  77. INTRODUCTION What Elvis does, Copyright, How to com-
  78. pile Elvis, Overview ..................................    1
  79.  
  80. VISUAL MODE COMMANDS Normal interactive editing,
  81. Input mode, Arrow keys, Digraphs, Abbreviations,
  82. Auto-indentation ......................................    2
  83.  
  84. COLON MODE COMMANDS Line specifiers, Text entry, Cut
  85. & paste, Display text, Global operations, Line edit-
  86. ing, Undo, Configuration & status, Multiple files,
  87. Switching files, Working with a compiler, Exiting,
  88. File I/O, Directory & shell, Debugging ................    3
  89.  
  90. REGULAR EXPRESSIONS Syntax, Options, Substitutions,
  91. Examples ..............................................    4
  92.  
  93. OPTIONS Autoindent, Autoprint, etc.  ..................    5
  94.  
  95. CUT BUFFERS Putting text into a cut buffer, Pasting
  96. from a cut buffer, Macros, The effect of switching
  97. files .................................................    6
  98.  
  99. DIFFERENCES BETWEEN Elvis AND THE REAL VI/EX Exten-
  100. sions, Omissions ......................................    7
  101.  
  102. INTERNAL For programmers only, The temporary file,
  103. Implementation of editing, Marks and the cursor,
  104. Colon command interpretation, Screen control, Porta-
  105. bility ................................................    8
  106.  
  107. MAKEFILE ..............................................    9
  108.  
  109. CFLAGS ................................................   10
  110.  
  111. TERMCAP ...............................................   11
  112.  
  113. ENVIRONMENT VARIABLES .................................   12
  114.  
  115. VERSIONS ..............................................   13
  116.  
  117. QUESTIONS & ANSWERS ...................................   14
  118.  
  119.  
  120.   UNIX-style "man" pages appear at the end of this manual.
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                      November 30, 1993
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135. 1.  INTRODUCTION
  136.  
  137.      Elvis is a clone of vi/ex, the  standard  UNIX  editor.
  138. Elvis  supports  nearly  all  of the vi/ex commands, in both
  139. visual mode and colon mode.
  140.  
  141.      Like vi/ex, Elvis stores most of the  text  in  a  tem-
  142. porary  file,  instead of RAM.  This allows it to edit files
  143. that are too large to fit in a single process'  data  space.
  144. Also, the edit buffer can survive a power failure or crash.
  145.  
  146.      Elvis runs under BSD UNIX, AT&T SysV UNIX,  Minix,  MS-
  147. DOS,  Atari  TOS,  Coherent,  OS9/68000,  VMS, AmigaDos, and
  148. OS/2.  The next version is also expected to  add  MS-Windows
  149. and  MacOS.   Contact me before you start porting it to some
  150. other OS, because somebody else may have already done it for
  151. you.
  152.  
  153.      Elvis is freely redistributable, in either source  form
  154. or  executable  form.   There are no restrictions on how you
  155. may use it.
  156.  
  157. 1.1.  Compiling
  158.  
  159.      See the "Versions" section of this manual for  instruc-
  160. tions on how to compile Elvis.
  161.  
  162.      If you want to port Elvis to another O.S. or  compiler,
  163. then  you  should start by reading the "Portability" part of
  164. the "Internal" section.
  165.  
  166. 1.2.  Overview of Elvis
  167.  
  168.      The user interface of Elvis/vi/ex is weird.  There  are
  169. two major command modes in Elvis, and a few text input modes
  170. as well.  Each command mode has a command which  allows  you
  171. to switch to the other mode.
  172.  
  173.      You will probably use the visual command mode  most  of
  174. the  time.   This  is the mode that Elvis normally starts up
  175. in.
  176.  
  177.      In visual command mode, the  entire  screen  is  filled
  178. with lines of text from your file.  Each keystroke is inter-
  179. preted as part of a visual command.   If  you  start  typing
  180. text, it will not be inserted, it will be treated as part of
  181. a command.  To insert text, you must first give  an  "insert
  182. text"  command.   This  will take some getting used to.  (An
  183. alternative exists.  Lookup the "inputmode" option.)
  184.  
  185.      The colon mode is quite different.   Elvis  displays  a
  186. ":" character on the bottom line of the screen, as a prompt.
  187. You are then expected to type in a command line and hit  the
  188. <Return>  key.   The set of commands recognized in the colon
  189.  
  190.  
  191.  
  192.                      November 30, 1993
  193.  
  194.  
  195.  
  196.  
  197.  
  198. 1-2                     INTRODUCTION                     1-2
  199.  
  200.  
  201. mode is different from visual mode's.
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.                      November 30, 1993
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267. 2.  VISUAL MODE COMMANDS
  268.  
  269.      Most visual mode commands are one keystroke long.   The
  270. following  table lists the operation performed by each keys-
  271. troke, and also denotes any options  or  arguments  that  it
  272. accepts.   Notes  at the end of the table describe the nota-
  273. tion used in this table.
  274.  
  275.      In addition to the keys listed  here,  your  keyboard's
  276. "arrow"  keys  will be interpreted as the appropriate cursor
  277. movement commands.  The same goes for <PgUp> and <PgDn>,  if
  278. your  keyboard  has  them.   The  <Insert>  key  will toggle
  279. between insert mode and replace mode.  There is a colon mode
  280. command (":map", to be described later) which will allow you
  281. to define other keys, such as function keys.
  282.  
  283.      A tip: visual command mode looks a lot like text  input
  284. mode.   If  you  forget  which  mode you're in, just hit the
  285. <Esc> key.  If Elvis beeps, then you're  in  visual  command
  286. mode.   If Elvis does not beep, then you were in input mode,
  287. but by hitting <Esc> you will have switched to  visual  com-
  288. mand  mode.   So, one way or another, after <Esc> Elvis will
  289. be ready for a command.
  290.  
  291. COMMAND      DESCRIPTION
  292.        ^A    Search for next occurrence of word at cursor (MOVE)(EXT)
  293.        ^B    Move toward the top of the file by 1 screenful
  294.        ^C    --- (usually sends SIGINT, to interrupt a command)
  295. count  ^D    Scroll down <count> lines (default 1/2 screen)
  296. count  ^E    Scroll up <count> lines
  297.        ^F    Move toward the bottom of the file by 1 screenful
  298.        ^G    Show file status, and the current line #
  299. count  ^H    Move left, like h (MOVE)
  300.        ^I    ---
  301. count  ^J    Move down (MOVE)
  302.        ^K    ---
  303.        ^L    Redraw the screen
  304. count  ^M    Move to the front of the next line (MOVE)
  305. count  ^N    Move down (MOVE)
  306.        ^O    ---
  307. count  ^P    Move up (MOVE)
  308.        ^Q    --- (typically XON, which restarts screen updates)
  309.        ^R    Redraw the screen
  310.        ^S    --- (typically XOFF, which stops screen updates)
  311.        ^T    Return to source of previous :tag or ^] command.
  312. count  ^U    Scroll up <count> lines (default 1/2 screen)
  313.        ^V    ---
  314.        ^W    ---
  315. count  ^X    Move to a physical column number on the screen (MOVE) (EXT)
  316. count  ^Y    Scroll down <count> lines
  317.        ^Z    --- (sometimes sends SIGSUSP, to suspend execution)
  318.        ESC   ---
  319.        ^\    --- (usually sends SIGQUIT, which is ignored)
  320.        ^]    If the cursor is on a tag name, go to that tag
  321.  
  322.  
  323.  
  324.                      November 30, 1993
  325.  
  326.  
  327.  
  328.  
  329.  
  330. 2-2                 VISUAL MODE COMMANDS                 2-2
  331.  
  332.  
  333.        ^^    Switch to the previous file, like ":e #"
  334. count  ^_    Move to a given screen-relative row (MOVE) (EXT)
  335. count  SPC   Move right,like l (MOVE)
  336.        ! mv  Run the selected lines thru an external filter program
  337.        " key Select which cut buffer to use next
  338. count  # +   Increment a number (EDIT) (EXT)
  339.        $     Move to the rear of the current line (MOVE)
  340. count  %     Move to matching (){}[] or to a given % of file (MOVE) (EXT)
  341. count  &     Repeat the previous ":s//" command here (EDIT)
  342.        ' key Move to a marked line (MOVE)
  343. count  (     Move backward <count> sentences (MOVE)
  344. count  )     Move forward <count> sentences (MOVE)
  345.        *     Go to the next error in the errlist (EXT)
  346. count  +     Move to the front of the next line (MOVE)
  347. count  ,     Repeat the previous [fFtT] but in the other direction (MOVE)
  348. count  -     Move to the front of the preceding line (MOVE)
  349. count  .     Repeat the previous "edit" command
  350.        / textSearch forward for a given regular expression (MOVE)
  351.        0     If not part of count, move to 1st char of this line (MOVE)
  352.        1     Part of count
  353.        2     Part of count
  354.        3     Part of count
  355.        4     Part of count
  356.        5     Part of count
  357.        6     Part of count
  358.        7     Part of count
  359.        8     Part of count
  360.        9     Part of count
  361.        : textRun single EX cmd
  362. count  ;     Repeat the previous [fFtT] cmd (MOVE)
  363.        < mv  Shift text left (EDIT)
  364.        = mv  Reformat
  365.        > mv  Shift text right (EDIT)
  366.        ? textSearch backward for a given regular expression (MOVE)
  367.        @ key Execute the contents of a cut-buffer as VI commands
  368. count  A inp Append at end of the line (EDIT)
  369. count  B     Move back Word (MOVE)
  370.        C inp Change text from the cursor through the end of the line (EDIT)
  371.        D     Delete text from the cursor through the end of the line (EDIT)
  372. count  E     Move end of Word (MOVE)
  373. count  F key Move leftward to a given character (MOVE)
  374. count  G     Move to line #<count> (default is the bottom line) (MOVE)
  375. count  H     Move to home row (the line at the top of the screen)
  376. count  I inp Insert at the front of the line (after indents) (EDIT)
  377. count  J     Join lines, to form one big line (EDIT)
  378.        K     Look up keyword (EXT)
  379. count  L     Move to last row (the line at the bottom of the screen)
  380.        M     Move to middle row
  381.        N     Repeat previous search, but in the opposite direction (MOVE)
  382. count  O inp Open up a new line above the current line (EDIT)
  383.        P     Paste text before the cursor (EDIT)
  384.        Q     Quit to EX mode
  385.        R inp Overtype (EDIT)
  386. count  S inp Change lines, like <count>cc
  387.  
  388.  
  389.  
  390.                      November 30, 1993
  391.  
  392.  
  393.  
  394.  
  395.  
  396. 2-3                 VISUAL MODE COMMANDS                 2-3
  397.  
  398.  
  399. count  T key Move leftward *almost* to a given character (MOVE)
  400.        U     Undo all recent changes to the current line
  401.        V     Start marking lines for c/d/y/</>/!/\ (EXT)
  402. count  W     Move forward <count> Words (MOVE)
  403. count  X     Delete the character(s) to the left of the cursor (EDIT)
  404. count  Y     Yank text line(s) (copy them into a cut buffer)
  405.        Z Z   Save the file & exit
  406.        [ [   Move back 1 section (MOVE)
  407.        \ mv  Pop-up menu for modifying text (EXT)
  408.        ] ]   Move forward 1 section (MOVE)
  409.        ^     Move to the front of the current line (after indent) (MOVE)
  410. count  _     Move to the current line
  411.        ` key Move to a marked character (MOVE)
  412. count  a inp Insert text after the cursor (EDIT)
  413. count  b     Move back <count> words (MOVE)
  414.        c mv  Change text (EDIT)
  415.        d mv  Delete text (EDIT)
  416. count  e     Move forward to the end of the current word (MOVE)
  417. count  f key Move rightward to a given character (MOVE)
  418.        g     ---
  419. count  h     Move left (MOVE)
  420. count  i inp Insert text at the cursor (EDIT)
  421. count  j     Move down (MOVE)
  422. count  k     Move up (MOVE)
  423. count  l     Move right (MOVE)
  424.        m key Mark a line or character
  425.        n     Repeat the previous search (MOVE)
  426. count  o inp Open a new line below the current line (EDIT)
  427.        p     Paste text after the cursor (EDIT)
  428.        q     ---
  429. count  r key Replace <count> chars by a given character (EDIT)
  430. count  s inp Replace <count> chars with text from the user (EDIT)
  431. count  t key Move rightward *almost* to a given character (MOVE)
  432.        u     Undo the previous edit command
  433.        v     Start marking characters for c/d/y/</>/!/\ (EXT)
  434. count  w     Move forward <count> words (MOVE)
  435. count  x     Delete the character that the cursor's on (EDIT)
  436.        y mv  Yank text (copy it into a cut buffer)
  437.        z key Scroll current line to the screen's +=top -=bottom .=middle
  438. count  {     Move back <count> paragraphs (MOVE)
  439. count  |     Move to column <count> (the leftmost column is 1)
  440. count  }     Move forward <count> paragraphs (MOVE)
  441. count  ~     Switch a character between uppercase & lowercase (EDIT)
  442.        DEL   --- (usually mapped to shift-X, so it deletes one character)
  443.  
  444.  
  445. count  Many commands may be preceded by a count.  This is  a
  446.        sequence  of  digits  representing  a decimal number.
  447.        For most commands that use a count,  the  command  is
  448.        repeated   <count>   times.    The  count  is  always
  449.        optional, and usually defaults to 1.
  450.  
  451. key    Some commands require two keystrokes.  The first  key
  452.        always  determines  which  command is to be executed.
  453.  
  454.  
  455.  
  456.                      November 30, 1993
  457.  
  458.  
  459.  
  460.  
  461.  
  462. 2-4                 VISUAL MODE COMMANDS                 2-4
  463.  
  464.  
  465.        The second key is used as a parameter to the command.
  466.  
  467. mv     Some commands (! < > c d  y  \  =)  operate  on  text
  468.        between  the  cursor  and some other position.  There
  469.        are three ways that you can specify that other  posi-
  470.        tion.
  471.  
  472.        The first way is to follow the command keystroke with
  473.        a movement command.  For example, "dw" deletes a sin-
  474.        gle word.  "d3w" and "3dw" both delete three words.
  475.  
  476.        The second way  is  to  type  the  command  keystroke
  477.        twice.   This  causes  whole  lines to be acted upon.
  478.        For example, ">>" indents the  current  line.   "3>>"
  479.        indents the current line and the following two lines.
  480.  
  481.        The last way is to move the cursor to one end of  the
  482.        text, type 'v' or 'V' to start marking, move the cur-
  483.        sor to the other end, and then type the desired  com-
  484.        mand key.
  485.  
  486. inp    Many commands allow the user to  interactively  enter
  487.        text.  See the discussion of "input mode" in the fol-
  488.        lowing section.
  489.  
  490. (EXT)  These commands are extensions -- the real vi  doesn't
  491.        have them.
  492.  
  493. (EDIT) These commands affect text, and may  be  repeated  by
  494.        the "." command.
  495.  
  496. (MOVE) These commands move the cursor, and may  be  used  to
  497.        specify  the  extent of a member of the "mv" class of
  498.        commands.
  499.  
  500. 2.1.  Input Mode
  501.  
  502.      You can't type text into your file directly from visual
  503. command  mode.  Instead, you must first give a command which
  504. will put you into input mode.  The commands to do  this  are
  505. A/C/I/O/R/S/a/i/o/s.
  506.  
  507.      The S/s/C/c commands temporarily place a $ at  the  end
  508. of the text that they are going to change.
  509.  
  510.      In input mode, all keystrokes  are  inserted  into  the
  511. text at the cursor's position, except for the following:
  512.  
  513.         ^A      insert a copy of the last input text
  514.         ^D      delete one indent character
  515.         ^H      (backspace) erase the character before the cursor
  516.         ^L      redraw the screen
  517.         ^M      (carriage return) insert a newline (^J, linefeed)
  518.         ^O      execute next key as a visual command (limited!)
  519.  
  520.  
  521.  
  522.                      November 30, 1993
  523.  
  524.  
  525.  
  526.  
  527.  
  528. 2-5                 VISUAL MODE COMMANDS                 2-5
  529.  
  530.  
  531.         ^P      insert the contents of the cut buffer
  532.         ^R      redraw the screen, like ^L
  533.         ^T      insert an indent character
  534.         ^U      backspace to the beginning of the line
  535.         ^V      insert the following keystroke, even if special
  536.         ^W      backspace to the beginning of the current word
  537.         ^Z^Z    write the file & exit Elvis
  538.         ^[      (ESCape) exit from input mode, back to command mode
  539.  
  540.  
  541.      Also, on some systems, ^S may stop output, ^Q may  res-
  542. tart  output,  and  ^C may interrupt execution.  ^@ (the NUL
  543. character) cannot be inserted.
  544.  
  545.      The R visual command puts you in overtype  mode,  which
  546. is  a  slightly  different  form of input mode.  In overtype
  547. mode, each time you insert a character, one of the old char-
  548. acters is deleted from the file.
  549.  
  550. 2.2.  Arrow keys in Input Mode
  551.  
  552.      The arrow keys can be used to move the cursor in  input
  553. mode.   (This  is  an extension; the real Vi doesn't support
  554. arrow keys in input mode.) The <PgUp>, <PgDn>,  <Home>,  and
  555. <End>  keys  work  in  input  mode,  too.   The <Delete> key
  556. deletes a single character in input mode.  The <Insert>  key
  557. toggles between input mode and replace mode.
  558.  
  559.      The best thing about allowing arrow  keys  to  work  in
  560. input  mode  is  that as long as you're in input mode, Elvis
  561. seems to have a fairly ordinary user interface.   With  most
  562. other  text editors, you are always in either insert mode or
  563. replace mode, and you can use the arrow keys at any time  to
  564. move  the  cursor.   Now,  Elvis can act like that, too.  In
  565. fact, with the new "inputmode"  option  and  the  "control-Z
  566. control-Z"  input  command,  you  may  never have to go into
  567. visual command mode for simple edit sessions.
  568.  
  569. 2.3.  Digraphs
  570.  
  571.      Elvis supports digraphs as a  way  to  enter  non-ASCII
  572. characters.   A  digraph is a character which is composed of
  573. two other characters.  For example, an  apostrophe  and  the
  574. letter i could be defined as a digraph which is to be stored
  575. & displayed as an accented i.
  576.  
  577.      There is no single standard for extended ASCII  charac-
  578. ter  sets.   Elvis  can be compiled to fill the digraph with
  579. values appropriate for either the IBM PC character  set,  or
  580. the  LATIN-1  character  set  used by X windows, or neither.
  581. (See the discussions of -DCS_IBMPC and  -DCS_LATIN1  in  the
  582. CFLAGS  section  of  this  manual.) You can view or edit the
  583. digraph table via the ":digraph" colon command.
  584.  
  585.  
  586.  
  587.  
  588.                      November 30, 1993
  589.  
  590.  
  591.  
  592.  
  593.  
  594. 2-6                 VISUAL MODE COMMANDS                 2-6
  595.  
  596.  
  597.      Digraphs will not be recognized  until  you've  entered
  598. ":set digraph".
  599.  
  600.      To actually use a digraph  type  the  first  character,
  601. then  hit  <Backspace>,  and then type the second character.
  602. Elvis will then substitute the non-ASCII character in  their
  603. place.
  604.  
  605. 2.4.  Abbreviations
  606.  
  607.      Elvis can expand abbreviations for you.  You define  an
  608. abbreviation  with  the :abbr command, and then whenever you
  609. type in the abbreviated form while in input mode, Elvis will
  610. immediately  replace  it with the long form.  COBOL program-
  611. mers should find this useful. :-)
  612.  
  613.      Elvis doesn't perform the substitution until you type a
  614. non-alphanumeric  character to mark the end of the word.  If
  615. you type a control-V before that non-alphanumeric character,
  616. then Elvis will not perform the substitution.
  617.  
  618. 2.5.  Auto-Indent
  619.  
  620.      With the ":set autoindent" option turned on, Elvis will
  621. automatically  insert leading whitespace at the beginning of
  622. each new line that you type in.  The leading  whitespace  is
  623. copied from the preceding line.
  624.  
  625.      To add more leading  whitespace,  type  control-T.   To
  626. remove some whitespace, type control-D.
  627.  
  628.      If you ":set noautotab", then the whitespace  generated
  629. by  control-T  will  always consist of spaces -- never tabs.
  630. Some people seem to prefer this.
  631.  
  632.      Elvis' autoindent mode isn't 100% compatible with vi's.
  633. In  Elvis, 0^D and ^^D don't work, ^U can wipeout all inden-
  634. tation, and sometimes Elvis will use a different  amount  of
  635. indentation than vi would.
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.                      November 30, 1993
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663. 3.  COLON MODE COMMANDS
  664.  
  665.         LINES               COMMAND   ARGUMENTS
  666.                             ab[br]    [short] [expanded form]
  667.                             an[d]     condition
  668.         [line]              a[ppend][!]
  669.                             ar[gs]    [files]
  670.                             cc        [files]
  671.                             cd[!]     [directory]
  672.         [line][,line]       c[hange]
  673.                             chd[ir][!][directory]
  674.         [line][,line]       co[py]    line
  675.                             col[or]   [when] [[light] color] [on color]
  676.         [line][,line]       d[elete]  [x]
  677.                             dig[raph][!][XX [Y]]
  678.                             e[dit][!] [file]
  679.                             el[se]    commands
  680.                             er[rlist][!][errlist]
  681.                             f[ile]    [file]
  682.         [line][,line]       g[lobal]  /regexp/ command
  683.                             if        condition
  684.         [line]              i[nsert]
  685.         [line][,line]       j[oin][!]
  686.         [line][,line]       l[ist]
  687.                             mak[e]    [target]
  688.                             map[!]    key mapped_to
  689.         [line]              ma[rk]    x
  690.                             mk[exrc]
  691.         [line][,line]       m[ove]    line
  692.                             n[ext][!] [files]
  693.                             N[ext][!]
  694.         [line][,line]       nu[mber]
  695.                             o[r]      condition
  696.                             po[p][!]
  697.         [line][,line]       p[rint]
  698.         [line]              pu[t]     [x]
  699.                             q[uit][!]
  700.         [line]              r[ead]    file
  701.                             rew[ind][!]
  702.                             se[t]     [options]
  703.                             so[urce]  file
  704.         [line][,line]       s[ubstitute]/regexp/replacement/[p][g][c]
  705.         [line][,line]       t         line
  706.                             ta[g][!]  tagname
  707.                             th[en]    commands
  708.                             una[bbr]  [short]
  709.                             u[ndo]
  710.                             unm[ap][!]key
  711.                             ve[rsion]
  712.         [line][,line]       v[global] /regexp/ command
  713.                             vi[sual]  [filename]
  714.                             wq
  715.         [line][,line]       w[rite][!][[>>]file]
  716.                             x[it][!]
  717.  
  718.  
  719.  
  720.                      November 30, 1993
  721.  
  722.  
  723.  
  724.  
  725.  
  726. 3-2                 COLON MODE COMMANDS                  3-2
  727.  
  728.  
  729.         [line][,line]       y[ank]    [x]
  730.         [line][,line]       !         command
  731.         [line][,line]       <
  732.         [line][,line]       =
  733.         [line][,line]       >
  734.         [line][,line]       &
  735.                             @          x
  736.  
  737.  
  738.      To use colon mode commands, you must switch from visual
  739. command  mode  to  colon command mode.  The visual mode com-
  740. mands to do this are ":" for a single colon command, or  "Q"
  741. for many colon mode commands.
  742.  
  743. 3.1.  Line Specifiers
  744.  
  745.      Line specifiers are always optional.   The  first  line
  746. specifier  of  most commands usually defaults to the current
  747. line.  The second line specifier usually defaults to be  the
  748. same  as  the  first line specifier.  Exceptions are :write,
  749. :global, and :vglobal, which act on all lines of the file by
  750. default, and :!, which acts on no lines by default.
  751.  
  752.      Line specifiers consist of an absolute part and a rela-
  753. tive  part.   The  absolute  part of a line specifier may be
  754. either an explicit line number, a mark, a dot to denote  the
  755. current  line,  a dollar sign to denote the last line of the
  756. file, or a forward or backward search.
  757.  
  758.      An explicit line number is  simply  a  decimal  number,
  759. expressed as a string of digits.
  760.  
  761.      A mark is typed in  as  an  apostrophe  followed  by  a
  762. letter.  Marks must be set before they can be used.  You can
  763. set a mark in visual  command  mode  by  typing  "m"  and  a
  764. letter,  or  you  can  set  it in colon command mode via the
  765. "mark" command.
  766.  
  767.      A forward search is typed in as  a  regular  expression
  768. surrounded  by  slash  characters;  searching  begins at the
  769. default line.  A backward search is typed in  as  a  regular
  770. expression surrounded by question marks; searching begins at
  771. the line before the default line.
  772.  
  773.      If you omit the absolute part, then the default line is
  774. used.
  775.  
  776.      The relative part of a line specifier is typed as a "+"
  777. or  "-"  character followed by a decimal number.  The number
  778. is added to or subtracted from the absolute part of the line
  779. specifier to produce the final line number.
  780.  
  781.      As a special case, the  %  character  may  be  used  to
  782. specify  all lines of the file.  It is roughly equivalent to
  783.  
  784.  
  785.  
  786.                      November 30, 1993
  787.  
  788.  
  789.  
  790.  
  791.  
  792. 3-3                 COLON MODE COMMANDS                  3-3
  793.  
  794.  
  795. saying 1,$.  This can be a handy shortcut.
  796.  
  797.      Some examples:
  798.  
  799.      :p           print the current line
  800.      :37p         print line 37
  801.      :'gp         print the line which contains mark g
  802.      :/foo/p      print the next line that contains "foo"
  803.      :$p          print the last line of the file
  804.      :20,30p      print lines 20 through 30
  805.      :1,$p        print all lines of the file
  806.      :%p          print all lines of the file
  807.      :/foo/-2,+4p print 5 lines around the next "foo"
  808.  
  809.  
  810. 3.2.  Text Entry Commands
  811.  
  812.         [line] append
  813.         [line][,line] change ["x]
  814.         [line] insert
  815.  
  816.  
  817.      The append command inserts  text  after  the  specified
  818. line.
  819.  
  820.      The insert command inserts text  before  the  specified
  821. line.
  822.  
  823.      The change command copies the range of lines into a cut
  824. buffer,  deletes  them,  and  inserts new text where the old
  825. text used to be.
  826.  
  827.      For all of these commands, you indicate the end of  the
  828. text  you're  inserting  by hitting ^D or by entering a line
  829. which contains only a period.
  830.  
  831. 3.3.  Cut & Paste Commands
  832.  
  833.         [line][,line] delete ["x]
  834.         [line][,line] yank ["x]
  835.         [line] put ["x]
  836.         [line][,line] copy line
  837.         [line][,line] to line
  838.         [line][,line] move line
  839.  
  840.  
  841.      The delete command copies the specified range of  lines
  842. into a cut buffer, and then deletes them.
  843.  
  844.      The yank command copies the specified  range  of  lines
  845. into a cut buffer, but does *not* delete them.
  846.  
  847.      The put command inserts text from a  cut  buffer  after
  848. the specified line.
  849.  
  850.  
  851.  
  852.                      November 30, 1993
  853.  
  854.  
  855.  
  856.  
  857.  
  858. 3-4                 COLON MODE COMMANDS                  3-4
  859.  
  860.  
  861.      The copy and to commands yank the  specified  range  of
  862. lines and then immediately paste them after some other line.
  863.  
  864.      The move command deletes the specified range  of  lines
  865. and  then immediately pastes them after some other line.  If
  866. the destination line comes after the deleted text,  then  it
  867. will  be  adjusted  automatically to account for the deleted
  868. lines.
  869.  
  870. 3.4.  Display Text Commands
  871.  
  872.         [line][,line] print
  873.         [line][,line] list
  874.         [line][,line] number
  875.  
  876.  
  877.      The print  command  displays  the  specified  range  of
  878. lines.
  879.  
  880.      The  number  command  displays  the  lines,  with  line
  881. numbers.
  882.  
  883.      The list command also displays them, but it is  careful
  884. to make control characters visible.
  885.  
  886. 3.5.  Global Operations Commands
  887.  
  888.         [line][,line] global /regexp/ command
  889.         [line][,line] vglobal /regexp/ command
  890.  
  891.  
  892.      The global command searches through the  lines  of  the
  893. specified  range  (or  through the whole file if no range is
  894. specified) for lines that contain a  given  regular  expres-
  895. sion.   It  then moves the cursor to each of these lines and
  896. runs some other command on them.
  897.  
  898.      The vglobal command is similar,  but  it  searches  for
  899. lines that don't contain the regular expression.
  900.  
  901. 3.6.  Line Editing Commands
  902.  
  903.         [line][,line] join[!]
  904.         [line][,line] ! program
  905.         [line][,line] <
  906.         [line][,line] >
  907.         [line][,line] substitute /regexp/replacement/[p][g][c]
  908.         [line][,line] &
  909.  
  910.  
  911.      The join command catenates all lines in  the  specified
  912. range  together to form one big line.  If only a single line
  913. is specified, then the following line is catenated onto  it.
  914. The  normal  ":join"  inserts  one or two spaces between the
  915.  
  916.  
  917.  
  918.                      November 30, 1993
  919.  
  920.  
  921.  
  922.  
  923.  
  924. 3-5                 COLON MODE COMMANDS                  3-5
  925.  
  926.  
  927. lines; the ":join!" variation (with a  '!')  doesn't  insert
  928. spaces.
  929.  
  930.      The ! command runs  an  external  filter  program,  and
  931. feeds the specified range of lines to it's stdin.  The lines
  932. are then replaced by the output of the  filter.   A  typical
  933. example would be ":'a,'z!sort" to sort the lines 'a,'z.
  934.  
  935.      The < and > commands shift the specified range of lines
  936. left  or  right,  normally  by the width of 1 tab character.
  937. The "shiftwidth" option determines the shifting amount.
  938.  
  939.      The substitute command finds the regular expression  in
  940. each  line,  and replaces it with the replacement text.  The
  941. "p" option causes the altered lines to be printed.  The  "g"
  942. option permits all instances of the regular expression to be
  943. found & replaced.  (Without "g", only the  first  occurrence
  944. in each line is replaced.) The "c" option asks for confirma-
  945. tion before each substitution.
  946.  
  947.      The & command repeats the  previous  substitution  com-
  948. mand.   Actually, "&" is equivalent to "s//~/" with the same
  949. options as last time.  It  searches  for  the  last  regular
  950. expression  that you specified for any purpose, and replaces
  951. it with the the same text that was used in the previous sub-
  952. stitution.
  953.  
  954. 3.7.  Undo Command
  955.  
  956.         undo
  957.  
  958.  
  959.      The undo command restores the file to the state it  was
  960. in before your most recent command which changed text.
  961.  
  962. 3.8.  Configuration & Status Commands
  963.  
  964.         map[!] [key mapped_to]
  965.         unmap[!] key
  966.         abbr [word expanded_form_of_word]
  967.         unabbr word
  968.         digraph[!] [XX [Y]]
  969.         set [options]
  970.         mkexrc
  971.         [line] mark "x
  972.         visual
  973.         version
  974.         [line][,line] =
  975.         file [file]
  976.         source file
  977.         @ "x
  978.         color [when] [["light"] color] ["on" color]
  979.  
  980.  
  981.  
  982.  
  983.  
  984.                      November 30, 1993
  985.  
  986.  
  987.  
  988.  
  989.  
  990. 3-6                 COLON MODE COMMANDS                  3-6
  991.  
  992.  
  993.      The map command allows you to configure Elvis to recog-
  994. nize  your  function  keys,  and  treat  them as though they
  995. transmitted some other  sequence  of  characters.   Normally
  996. this  mapping  is done only when in the visual command mode,
  997. but with the [!] present it will map keys  under  input  and
  998. replace  modes  as well.  When this command is given with no
  999. arguments, it prints a table showing all mappings  currently
  1000. in effect.  When called with two arguments, the first is the
  1001. sequence that your function key really sends, and the second
  1002. is  the  sequence  that you want Elvis to treat it as having
  1003. sent.  As a special case, if the first  argument  is  a  '#'
  1004. sign   followed   by  a  number  then  Elvis  will  map  the
  1005. corresponding function key; for example, ":map #7  dd"  will
  1006. cause the <F7> key to delete a line.  Also, on some systems,
  1007. ":map #7s ..." may map <Shift-F7>, ":map #7c  ..."  may  map
  1008. <Control-F7>, and ":map #7a ..." may map <Alt-F7>.
  1009.  
  1010.      The unmap command removes  key  definitions  that  were
  1011. made via the map command.
  1012.  
  1013.      The abbr command is used  to  define/list  a  table  of
  1014. abbreviations.  The table contains both the abbreviated form
  1015. and the fully spelled-out form.  When you're in visual input
  1016. mode,  and  you  type  in  the  abbreviated form, Elvis will
  1017. replace the abbreviated  form  with  the  fully  spelled-out
  1018. form.   When  this  command  is called without arguments, it
  1019. lists the table; with two or more arguments, the first argu-
  1020. ment  is  taken as the abbreviated form, and the rest of the
  1021. command line is the fully-spelled out form.
  1022.  
  1023.      The unabbr command deletes entries from the abbr table.
  1024.  
  1025.      The digraph command allows you to display  the  set  of
  1026. digraphs  that  Elvis is using, or add/remove a digraph.  To
  1027. list the set of digraphs, use the digraph  command  with  no
  1028. arguments.   To  add  a digraph, you should give the digraph
  1029. command two arguments.  The first argument is the two  ASCII
  1030. characters  that  are to be combined; the second is the non-
  1031. ASCII  character  that  they   represent.    The   non-ASCII
  1032. character's most significant bit is automatically set by the
  1033. digraph command, unless to append a ! to the  command  name.
  1034. Removal  of a digraph is similar to adding a digraph, except
  1035. that you should leave off the second argument.
  1036.  
  1037.      The set command  allows  you  examine  or  set  various
  1038. options.   With  no  arguments,  it  displays  the values of
  1039. options that have been changed.  With  the  single  argument
  1040. "all"  it  displays the values of all options, regardless of
  1041. whether they've been explicitly set or not.  Otherwise,  the
  1042. arguments are treated as options to be set.
  1043.  
  1044.      The mkexrc command saves the current configuration to a
  1045. file called ".exrc" in the current directory.
  1046.  
  1047.  
  1048.  
  1049.  
  1050.                      November 30, 1993
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056. 3-7                 COLON MODE COMMANDS                  3-7
  1057.  
  1058.  
  1059.      The mark command defines a named mark  to  refer  to  a
  1060. specific  place in the file.  This mark may be used later to
  1061. specify lines for other commands.
  1062.  
  1063.      The visual command puts the editor  into  visual  mode.
  1064. Instead of emulating ex, Elvis will start emulating vi.
  1065.  
  1066.      The version command tells  you  that  what  version  of
  1067. Elvis this is.
  1068.  
  1069.      The = command tells you what line you specified, or, if
  1070. you  specified  a range of lines, it will tell you both end-
  1071. points and the number of lines included in the range.
  1072.  
  1073.      The file command  tells  you  the  name  of  the  file,
  1074. whether  it  has  been  modified, the number of lines in the
  1075. file, and the current line number.  You can also use  it  to
  1076. change the name of the current file.
  1077.  
  1078.      The source command reads a sequence of colon mode  com-
  1079. mands from a file, and interprets them.
  1080.  
  1081.      The @ command executes the contents of a cut-buffer  as
  1082. EX commands.
  1083.  
  1084.      The color command only works under MS-DOS,  or  if  you
  1085. have  an  ANSI-compatible  color terminal.  It allows you to
  1086. set the foreground and background colors for different types
  1087. of  text: normal, bold, italic, underlined, standout, pop-up
  1088. menu, and visible selection.  By  default,  it  changes  the
  1089. "normal"  colors; to change other colors, the first argument
  1090. to the :color command should be the first letter of the type
  1091. of  text  you want.  The syntax for the colors themselves is
  1092. fairly intuitive.  For example, ":color light cyan on  blue"
  1093. causes  normal  text to be displayed in light cyan on a blue
  1094. background, and ":color b bright white" causes bold text  to
  1095. be  displayed  in  bright  white  on a blue background.  The
  1096. background color always defaults to the  current  background
  1097. color  of  normal  text.   Your  first  :color  command must
  1098. specify both the foreground and background for normal text.
  1099.  
  1100. 3.9.  Conditional Commands
  1101.  
  1102.         if condition
  1103.         and condition
  1104.         or condition
  1105.         then commands
  1106.         else commands
  1107.  
  1108.  
  1109.      These commands allow Elvis to execute a set of commands
  1110. only  if  a  given  condition is valid.  The if, and, and or
  1111. commands set or clear a flag, and the then and else commands
  1112. test  that flag to decide whether to execute their arguments
  1113.  
  1114.  
  1115.  
  1116.                      November 30, 1993
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122. 3-8                 COLON MODE COMMANDS                  3-8
  1123.  
  1124.  
  1125. as commands.  This can be handy in .exrc files.
  1126.  
  1127.      A condition can test the following types of values:
  1128.  
  1129.  
  1130.         constants - either a number or a quoted string
  1131.         options - the name of a :set option
  1132.         termcap fields - a two letter name, enclosed in colons
  1133.         environment variables - the name, preceded by a dollar sign
  1134.  
  1135.  
  1136.      The condition can involve either one boolean value, two
  1137. strings  compared  for  equality  ("=" or "==") or inquality
  1138. ("!="), or two numbers compared with any  comparison  opera-
  1139. tor.
  1140.  
  1141.      The if command sets the conditional flag equal  to  the
  1142. results  of the condition.  The and command performs a logi-
  1143. cal AND of the conditional flag and the new condition.   The
  1144. or command performs a logical OR of the conditional flag and
  1145. the new condition.
  1146.  
  1147.      The then command's arguments are one or more  commands.
  1148. (Commands  can  be  delimited  by  placing  a  '|' character
  1149. between them.) The commands are executed if the  conditional
  1150. flag  is  true,  or skipped if it is false.  Similarly, else
  1151. executes its arguments  only  if  the  conditional  flag  is
  1152. false.
  1153.  
  1154.      For example, on my Linux system the console can  handle
  1155. color commands, but xterms can't.  To have colors set on the
  1156. console but not on an xterm, I added  the  following  to  my
  1157. .exrc file...
  1158.  
  1159.  
  1160.         if term="console"
  1161.         then color yellow on blue | color quit white on blue
  1162.  
  1163.  
  1164. 3.10.  Multiple File Commands
  1165.  
  1166.         args [files]
  1167.         next[!] [files]
  1168.         Next[!]
  1169.         previous[!]
  1170.         rewind[!]
  1171.  
  1172.  
  1173.      When you invoke Elvis from your shell's  command  line,
  1174. any filenames that you give to Elvis as arguments are stored
  1175. in the args list.  The args command will display this  list,
  1176. or define a new one.
  1177.  
  1178.      The next command switches from the current file to  the
  1179.  
  1180.  
  1181.  
  1182.                      November 30, 1993
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188. 3-9                 COLON MODE COMMANDS                  3-9
  1189.  
  1190.  
  1191. next  one in the args list.  You may specify a new args list
  1192. here, too.
  1193.  
  1194.      The Next and previous commands (they're really  aliases
  1195. for  the  same  command) switch from the current file to the
  1196. preceding file in the args list.
  1197.  
  1198.      The rewind command switches from the  current  file  to
  1199. the first file in the args list.
  1200.  
  1201. 3.11.  Switching Files
  1202.  
  1203.         edit[!] [file]
  1204.         tag[!] tagname
  1205.         pop[!]
  1206.  
  1207.  
  1208.      The edit command allows to switch from the current file
  1209. to  some  other  file.  This has nothing to do with the args
  1210. list, by the way.
  1211.  
  1212.      The tag command looks up a  given  tagname  in  a  file
  1213. called  "tags".  This tells it which file the tag is in, and
  1214. how to find it in that file.  Elvis  then  switches  to  the
  1215. tag's file and finds the tag.
  1216.  
  1217.      The pop command reverses a tag  command.   It  switches
  1218. back  to the file and line number from which you invoked the
  1219. tag command.  Up to 15 tag commands  can  be  reversed;  the
  1220. filenames  and line numbers are saved on a stack, so you can
  1221. perform multiple tag commands, and then  reverse  them  with
  1222. multiple pop commands.
  1223.  
  1224. 3.12.  Working with a Compiler
  1225.  
  1226.         cc [files]
  1227.         make [target]
  1228.         errlist[!] [errlist]
  1229.  
  1230.  
  1231.      The cc and  make  commands  execute  your  compiler  or
  1232. "make"  utility  and redirect any error messages into a file
  1233. called "errlist".  By default, cc  is  run  on  the  current
  1234. file.  (You should write it before running cc.) The contents
  1235. of the "errlist" file are then scanned for  error  messages.
  1236. If  an  error  message is found, then the cursor is moved to
  1237. the line where the error was detected, and  the  description
  1238. of the error is displayed on the status line.
  1239.  
  1240.      After you've fixed one error, the errlist command  will
  1241. move  the cursor to the next error.  In visual command mode,
  1242. hitting `*' will do this, too.
  1243.  
  1244.      You can also create an "errlist" file from  outside  of
  1245.  
  1246.  
  1247.  
  1248.                      November 30, 1993
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254. 3-10                COLON MODE COMMANDS                 3-10
  1255.  
  1256.  
  1257. Elvis, and use "elvis -m" to start Elvis and have the cursor
  1258. moved to the first error.  Note that you don't need to  sup-
  1259. ply  a  filename  with "elvis -m" because the error messages
  1260. always say which source file an error is in.
  1261.  
  1262.      Note: When you use errlist repeatedly  to  fix  several
  1263. errors  in  a  single  file,  it  will attempt to adjust the
  1264. reported line numbers to  allow  for  lines  that  you  have
  1265. inserted  or  deleted.   These adjustments are made with the
  1266. assumption that you will  work  though  the  file  from  the
  1267. beginning to the end.
  1268.  
  1269. 3.13.  Exit Commands
  1270.  
  1271.         quit[!]
  1272.         wq
  1273.         xit
  1274.  
  1275.  
  1276.      The quit command exits from the editor  without  saving
  1277. your file.
  1278.  
  1279.      The wq command writes your file out, then then exits.
  1280.  
  1281.      The xit command is similar to the  wq  command,  except
  1282. that  xit  won't  bother  to  write your file if you haven't
  1283. modified it.
  1284.  
  1285. 3.14.  File I/O Commands
  1286.  
  1287.         [line] read file
  1288.         [line][,line] write[!] [[>>]file]
  1289.  
  1290.  
  1291.      The read  command  gets  text  from  another  file  and
  1292. inserts  it  after the specified line.  It can also read the
  1293. output of a program; simply precede the program  name  by  a
  1294. '!' and use it in place of the file name.
  1295.  
  1296.      The write command writes the whole file, or  just  part
  1297. of  it,  to some other file.  The !, if present, will permit
  1298. the lines to be written even  if  you've  set  the  readonly
  1299. option.   If  you  precede the filename by >> then the lines
  1300. will be appended to the file.  You can send the lines to the
  1301. standard input of a program by replacing the filename with a
  1302. '!' followed by the command and its arguments.
  1303.  
  1304.      Note: Be careful not to confuse ":w!filename"  and  ":w
  1305. !command".   To  write  to a program, you must have at least
  1306. one blank before the '!'.
  1307.  
  1308. 3.15.  Directory Commands
  1309.  
  1310.         cd [directory]
  1311.  
  1312.  
  1313.  
  1314.                      November 30, 1993
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320. 3-11                COLON MODE COMMANDS                 3-11
  1321.  
  1322.  
  1323.         chdir [directory]
  1324.         shell
  1325.  
  1326.  
  1327.      The cd and chdir commands (really  two  names  for  one
  1328. command) switch the current working directory.
  1329.  
  1330.      The shell command starts an interactive shell.
  1331.  
  1332. 3.16.  Debugging Commands
  1333.  
  1334.         [line][,line] debug[!]
  1335.         validate[!]
  1336.  
  1337.  
  1338.      These commands are only available if you compile  Elvis
  1339. with the -DDEBUG flag.
  1340.  
  1341.      The debug command lists statistics for the blocks which
  1342. contain  the specified range of lines.  If the ! is present,
  1343. then the contents of those blocks is displayed, too.
  1344.  
  1345.      The  validate  command  checks  certain  variables  for
  1346. internal  consistency.   Normally it doesn't output anything
  1347. unless it detects a problem.  With the !,  though,  it  will
  1348. always produce *some* output.
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.                      November 30, 1993
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389. 4.  REGULAR EXPRESSIONS
  1390.  
  1391.  
  1392.      Elvis uses regular expressions for searching  and  sub-
  1393. stitutions.   A regular expression is a text string in which
  1394. some characters have special meanings.  This  is  much  more
  1395. powerful than simple text matching.
  1396.  
  1397. Syntax
  1398.  
  1399.      Elvis' regexp package  treats  the  following  one-  or
  1400. two-character  strings  (called  meta-characters) in special
  1401. ways:
  1402.  
  1403. \(subexpression\)
  1404.         The \( and \) metacharacters  are  used  to  delimit
  1405.         subexpressions.  When the regular expression matches
  1406.         a particular chunk  of  text,  Elvis  will  remember
  1407.         which  portion  of that chunk matched the subexpres-
  1408.         sion.  The :s/regexp/newtext/ command makes  use  of
  1409.         this feature.
  1410.  
  1411. ^       The ^ metacharacter matches the beginning of a line.
  1412.         If,  for  example,  you  wanted to find "foo" at the
  1413.         beginning of a line, you would use a regular expres-
  1414.         sion  such  as  /^foo/.  Note that ^ is only a meta-
  1415.         character if it occurs at the beginning of a regular
  1416.         expression; anyplace else, it is treated as a normal
  1417.         character.
  1418.  
  1419. $       The $ metacharacter matches the end of a  line.   It
  1420.         is only a metacharacter when it occurs at the end of
  1421.         a regular expression; elsewhere, it is treated as  a
  1422.         normal  character.  For example, the regular expres-
  1423.         sion /$$/ will search for a dollar sign at  the  end
  1424.         of a line.
  1425.  
  1426. \<      The \< metacharacter matches a zero-length string at
  1427.         the beginning of a word.  A word is considered to be
  1428.         a string of 1 or more letters and  digits.   A  word
  1429.         can  begin  at the beginning of a line or after 1 or
  1430.         more non-alphanumeric characters.
  1431.  
  1432. \>      The \> metacharacter matches a zero-length string at
  1433.         the end of a word.  A word can end at the end of the
  1434.         line or before 1 or  more  non-alphanumeric  charac-
  1435.         ters.    For   example,  /\<end\>/  would  find  any
  1436.         instance of the word "end",  but  would  ignore  any
  1437.         instances  of  e-n-d  inside  another  word  such as
  1438.         "calendar".
  1439.  
  1440. .       The . metacharacter matches any single character.
  1441.  
  1442. [character-list]
  1443.  
  1444.  
  1445.  
  1446.                      November 30, 1993
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452. 4-2                 REGULAR EXPRESSIONS                  4-2
  1453.  
  1454.  
  1455.         This  matches  any   single   character   from   the
  1456.         character-list.   Inside the character-list, you can
  1457.         denote a span of  characters  by  writing  only  the
  1458.         first  and  last  characters,  with a hyphen between
  1459.         them.  If the character-list  is  preceded  by  a  ^
  1460.         character,  then  the  list  is  inverted -- it will
  1461.         match character that isn't mentioned  in  the  list.
  1462.         For  example, /[a-zA-Z]/ matches any letter, and /[^
  1463.         ]/ matches anything other than a blank.
  1464.  
  1465. \{n\}   This is a closure operator, which means that it  can
  1466.         only be placed after something that matches a single
  1467.         character.  It controls the number of times that the
  1468.         single-character expression should be repeated.
  1469.  
  1470.         The \{n\} operator, in particular,  means  that  the
  1471.         preceding  expression  should  be repeated exactly n
  1472.         times.  For example, /^-\{80\}$/ matches a  line  of
  1473.         eighty  hyphens, and /\<[a-zA-Z]\{4\}\>/ matches any
  1474.         four-letter word.
  1475.  
  1476. \{n,m\} This is a closure  operator  which  means  that  the
  1477.         preceding   single-character  expression  should  be
  1478.         repeated between n and m times, inclusive.  If the m
  1479.         is  omitted  (but  the  comma  is present) then m is
  1480.         taken to be infinity.  For example,  /"[^"]\{3,5\}"/
  1481.         matches  any  pair  of  quotes which contains three,
  1482.         four, or five non-quote characters.
  1483.  
  1484. *       The * metacharacter  is  a  closure  operator  which
  1485.         means that the preceding single-character expression
  1486.         can  be  repeated  zero  or  more  times.    It   is
  1487.         equivalent  to  \{0,\}.  For example, /.*/ matches a
  1488.         whole line.
  1489.  
  1490. \+      The \+ metacharacter is  a  closure  operator  which
  1491.         means that the preceding single-character expression
  1492.         can be repeated one or more times.  It is equivalent
  1493.         to \{1,\}.  For example, /.\+/ matches a whole line,
  1494.         but only if the line contains at least  one  charac-
  1495.         ter.  It doesn't match empty lines.
  1496.  
  1497. \?      The \? metacharacter is  a  closure  operator  which
  1498.         indicates   that   the   preceding  single-character
  1499.         expression is optional -- that is, that it can occur
  1500.         0  or  1  times.   It is equivalent to \{0,1\}.  For
  1501.         example, /no[ -]\?one/ matches "no  one",  "no-one",
  1502.         or "noone".
  1503.  
  1504.      Anything else is treated as a  normal  character  which
  1505. must  exactly  match a character from the scanned text.  The
  1506. special strings may all be preceded by a backslash to  force
  1507. them to be treated normally.
  1508.  
  1509.  
  1510.  
  1511.  
  1512.                      November 30, 1993
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518. 4-3                 REGULAR EXPRESSIONS                  4-3
  1519.  
  1520.  
  1521. Substitutions
  1522.  
  1523.      The :s command has at least two  arguments:  a  regular
  1524. expression,  and  a  substitution  string.   The  text  that
  1525. matched the regular expression is replaced by text which  is
  1526. derived from the substitution string.
  1527.  
  1528.      Most characters in the substitution string  are  copied
  1529. into the text literally but a few have special meaning:
  1530.  
  1531.        &     Insert a copy of the original text
  1532.        ~     Insert a copy of the previous replacement text
  1533.        \1    Insert a copy of that portion of the original text which
  1534.              matched the first set of \( \) parentheses
  1535.        \2-\9 Do the same for the second (etc.) pair of \( \)
  1536.        \U    Convert all chars of any later & or \# to uppercase
  1537.        \L    Convert all chars of any later & or \# to lowercase
  1538.        \E    End the effect of \U or \L
  1539.        \u    Convert the first char of the next & or \# to uppercase
  1540.        \l    Convert the first char of the next & or \# to lowercase
  1541.  
  1542.  
  1543.      These may be preceded by a backslash to force  them  to
  1544. be treated normally.  If "nomagic" mode is in effect, then &
  1545. and ~ will be treated normally, and you must write  them  as
  1546. \& and \~ for them to have special meaning.
  1547.  
  1548. Options
  1549.  
  1550.      Elvis has two options  which  affect  the  way  regular
  1551. expressions  are used.  These options may be examined or set
  1552. via the :set command.
  1553.  
  1554.      The first option is  called  "[no]magic".   This  is  a
  1555. boolean  option, and it is "magic" (TRUE) by default.  While
  1556. in  magic  mode,  all  of  the  meta-characters  behave   as
  1557. described above.  In nomagic mode, only ^ and $ retain their
  1558. special meaning.
  1559.  
  1560.      The second option is called "[no]ignorecase".  This  is
  1561. a  boolean  option,  and  it  is  "noignorecase"  (FALSE) by
  1562. default.  While in ignorecase mode, the searching  mechanism
  1563. will  not  distinguish  between  an uppercase letter and its
  1564. lowercase form.  In noignorecase mode, uppercase and  lower-
  1565. case are treated as being different.
  1566.  
  1567.      Also, the "[no]wrapscan" option affects searches.
  1568.  
  1569. Examples
  1570.  
  1571.      This example changes every occurrence of  "utilize"  to
  1572. "use":
  1573.  
  1574.           :%s/utilize/use/g
  1575.  
  1576.  
  1577.  
  1578.                      November 30, 1993
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584. 4-4                 REGULAR EXPRESSIONS                  4-4
  1585.  
  1586.  
  1587.      This example deletes all whitespace that occurs at  the
  1588. end of a line anywhere in the file.  (The brackets contain a
  1589. single space and a single tab.):
  1590.  
  1591.           :%s/[   ]\+$//
  1592.  
  1593.      This example converts the current line to uppercase:
  1594.  
  1595.           :s/.*/\U&/
  1596.  
  1597.      This example underlines  each  letter  in  the  current
  1598. line,  by  changing it into an "underscore backspace letter"
  1599. sequence.  (The ^H is entered as "control-V backspace".):
  1600.  
  1601.           :s/[a-zA-Z]/_^H&/g
  1602.  
  1603.      This example locates the last  colon  in  a  line,  and
  1604. swaps  the  text  before  the  colon with the text after the
  1605. colon.  The first \( \) pair is used to  delimit  the  stuff
  1606. before  the  colon,  and  the  second pair delimit the stuff
  1607. after.  In the substitution text, \1 and  \2  are  given  in
  1608. reverse order to perform the swap:
  1609.  
  1610.           :s/\(.*\):\(.*\)/\2:\1/
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.                      November 30, 1993
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653. 5.  OPTIONS
  1654.  
  1655.      Options may be set or examined via  the  colon  command
  1656. "set".   The  values of options will affect the operation of
  1657. later commands.
  1658.  
  1659.      For convenience, options have both a  long  descriptive
  1660. name  and  a  short name which is easy to type.  You may use
  1661. either  name  interchangeably.   I  like  the  short  names,
  1662. myself.
  1663.  
  1664.      There are three types of options: Boolean, string,  and
  1665. numeric.   Boolean  options are made TRUE by giving the name
  1666. of the option as an argument to the "set" command; they  are
  1667. made  FALSE  by  prefixing the name with "no".  For example,
  1668. "set autoindent" makes the autoindent option TRUE, and  "set
  1669. noautoindent"  makes  it  FALSE.   Elvis also allows boolean
  1670. options to be toggled by prefixing the name with "neg".  So,
  1671. ":map  g  :set  neglist^M"  will cause the <g> key to alter-
  1672. nately toggle the "list" option on and off.  (The "neg" pre-
  1673. fix is an extension; the real vi doesn't support it.)
  1674.  
  1675.      To change the value of a string or numeric option, pass
  1676. the "set" command the name of the option, followed by an "="
  1677. sign  and  the  option's  new  value.   For  example,   "set
  1678. tabstop=8"  will  give the tabstop option a value of 8.  For
  1679. string options, you may enclose the new value in quotes.
  1680.  
  1681. NAMES              TYPE DEFAULT       MEANING
  1682. autoindent, ai     Bool noai          auto-indent during input
  1683. autoprint, ap      Bool ap            in EX, print the current line
  1684. autotab, at        Bool at            auto-indent allowed to use tabs?
  1685. autowrite, aw      Bool noaw          auto-write when switching files
  1686. beautify,  bf      Bool nobf          strip control chars from file?
  1687. charattr, ca       Bool noca          interpret \fX sequences?
  1688. cc, cc             Str  cc="cc -c"    name of the C compiler
  1689. columns, co        Num  co=80         width of the screen
  1690. digraph, dig       Bool nodig         recognize digraphs?
  1691. directory, dir     Str  dir="/usr/tmp"where tmp files are kept
  1692. edcompatible, ed   Bool noed          remember ":s//" options
  1693. equalprg, ep       Bool ep="fmt"      program to run for = operator
  1694. errorbells, eb     Bool eb            ring bell on error
  1695. exrc, exrc         Bool noexrc        read "./.exrc" file?
  1696. exrefresh, er      Bool er            write lines individually in EX
  1697. flash, vbell       Bool flash         use visible alternative to bell
  1698. flipcase, fc       Str  fc=""         non-ASCII chars flipped by ~
  1699. hideformat, hf     Bool hf            hide text formatter commands
  1700. ignorecase, ic     Bool noic          upper/lowercase match in search
  1701. inputmode, im      Bool noim          start vi in insert mode?
  1702. keytime, kt        Num  kt=2          timeout for mapped key entry
  1703. keywordprg, kp     Str  kp="ref"      full pathname of shift-K prog
  1704. lines, ln          Num  ln=25         number of lines on the screen
  1705. list, li           Bool noli          display lines in "list" mode
  1706. magic, ma          Bool ma            use regular expression in search
  1707.  
  1708.  
  1709.  
  1710.                      November 30, 1993
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716. 5-2                       OPTIONS                        5-2
  1717.  
  1718.  
  1719. make, mk           Str  mk="make"     name of the "make" program
  1720. mesg, ms           Bool ms            allow messages from other users?
  1721. modelines, ml      Bool noml          are modelines processed?
  1722. more, more         Bool more          pause between messages?
  1723. nearscroll, ns     Num  ns=15         when to scroll vs. redraw
  1724. novice, nov        Bool nonovice      set options for ease of use
  1725. number, nu         Bool nonumber      show line numbers
  1726. paragraphs, para   Str  para="PPppIPLPQP"names of "paragraph" nroff cmd
  1727. prompt, pr         Bool pr            show ':' prompt in ex mode
  1728. readonly, ro       Bool noro          prevent overwriting of orig file
  1729. remap, rem         Bool remap         allow key maps to call key maps
  1730. report, re         Num  re=5          report when 5 or more changes
  1731. ruler, ru          Bool noru          display line/column numbers
  1732. scroll, sc         Num  sc=12         scroll amount for ^U and ^D
  1733. sections, sect     Str  sect="NHSHSSSEse"names of "section" nroff cmd
  1734. shell, sh          Str  sh="/bin/sh"  full pathname of the shell
  1735. showmatch, sm      Bool nosm          show matching ()[]{}
  1736. showmode, smd      Bool nosmd         say when we're in input mode
  1737. shiftwidth, sw     Num  sw=8          shift amount for < and >
  1738. sidescroll, ss     Num  ss=8          amount of sideways scrolling
  1739. sync, sy           Bool nosy          call sync() often
  1740. tabstop, ts        Num  ts=8          width of tab characters
  1741. taglength, tl      Num  tl=0          significant chars in tag name
  1742. tags, tag          Str  tags="tags" list of tags files
  1743. tagstack, tgs      Bool tgs           enable tagstack?
  1744. term, te           Str  te="$TERM"    name of the termcap entry
  1745. terse, tr          Bool notr          give shorter error messages
  1746. timeout, to        Bool to            distinguish <esc> from <arrow>?
  1747. warn, wa           Bool wa            warn for ! if file modified
  1748. window, wi         Num  wi=24         lines to redraw after long move
  1749. wrapmargin, wm     Num  wm=0          wrap long lines in input mode
  1750. wrapscan, ws       Bool ws            at EOF, searches wrap to line 1
  1751. writeany, wr       Bool nowr          allow :w to clobber files
  1752.  
  1753.  
  1754. autoindent, ai
  1755.      During input mode, the  autoindent  option  will  cause
  1756.      each  added line to begin with the same amount of lead-
  1757.      ing whitespace as the line above it.   Without  autoin-
  1758.      dent, added lines are initially empty.
  1759.  
  1760. autoprint, ap
  1761.      This option only affects EX  mode.   If  the  autoprint
  1762.      option  on,  and  either the cursor has moved to a dif-
  1763.      ferent line or the previous command modified the  file,
  1764.      then Elvis will print the current line.
  1765.  
  1766. autotab, at
  1767.      This option affects  the  behavior  of  the  autoindent
  1768.      mode.  If autoindent is turned off, then autotab has no
  1769.      effect.
  1770.  
  1771.      When autotab is turned on, elvis will use a mixture  of
  1772.      spaces   and  tabs  to  create  the  proper  amount  of
  1773.  
  1774.  
  1775.  
  1776.                      November 30, 1993
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782. 5-3                       OPTIONS                        5-3
  1783.  
  1784.  
  1785.      indentation.  This is the default.
  1786.  
  1787.      When autotab is turned off, elvis will only use  spaces
  1788.      for  auto-indent.   Elvis  will still insert a real tab
  1789.      character when you hit the <Tab> key, though; the auto-
  1790.      tab option only affects automatic indentation.
  1791.  
  1792. autowrite, aw
  1793.      When you're editing one file and decide  to  switch  to
  1794.      another  -  via  the  :tag  command,  or :next command,
  1795.      perhaps - if your current file has been modified,  then
  1796.      Elvis  will  normally print an error message and refuse
  1797.      to switch.
  1798.  
  1799.      However, if the autowrite option is on, then Elvis will
  1800.      write the modified version of the current file and suc-
  1801.      cessfully switch to the new file.
  1802.  
  1803. beautify, bf
  1804.      This option causes all control characters to be deleted
  1805.      from  the text file, at the time when you start editing
  1806.      it.  If you're already editing a file when you turn  on
  1807.      the beautify option, then that file won't be affected.
  1808.  
  1809. cc   The :cc command  runs  the  C  compiler.   This  option
  1810.      should be set to the name of your compiler.
  1811.  
  1812. charattr, ca
  1813.      Many text formatting programs allow  you  to  designate
  1814.      portions  of your text to be underlined, italicized, or
  1815.      boldface by embedding the special strings \fU, \fI, and
  1816.      \fB in your text.  The special string \fP marks the end
  1817.      of underlined or boldface text.
  1818.  
  1819.      Elvis normally treats those special strings  just  like
  1820.      any other text.
  1821.  
  1822.      However, if the charattr option is on, then Elvis  will
  1823.      interpret  those  special strings correctly, to display
  1824.      underlined or boldface text on the screen.  (This  only
  1825.      works,  of  course, if your terminal can display under-
  1826.      lined and boldface, and if the TERMCAP entry  says  how
  1827.      to do it.)
  1828.  
  1829. columns, co
  1830.      This option shows how wide your screen is.
  1831.  
  1832. digraph, dig
  1833.      This option is used to  enable/disable  recognition  of
  1834.      digraphs.   The default value is nodigraph, which means
  1835.      that digraphs will not be recognized.
  1836.  
  1837. directory, dir
  1838.      Elvis stores text  in  temporary  files.   This  option
  1839.  
  1840.  
  1841.  
  1842.                      November 30, 1993
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848. 5-4                       OPTIONS                        5-4
  1849.  
  1850.  
  1851.      allows  you  to control which directory those temporary
  1852.      files will appear in.  The default is /usr/tmp.
  1853.  
  1854.      This option can only be set  in  a  .exrc  file;  after
  1855.      that,  Elvis will have already started making temporary
  1856.      files in some other directory, so it would be too late.
  1857.  
  1858. edcompatible, ed
  1859.      This   option   affects    the    behavior    of    the
  1860.      ":s/regexp/text/options"  command.   It is normally off
  1861.      (:se noed) which causes all of the substitution options
  1862.      to be off unless explicitly given.
  1863.  
  1864.      However, with edcompatible on (:se ed),  the  substitu-
  1865.      tion  command  remembers  which  options  you used last
  1866.      time.  Those same options  will  continue  to  be  used
  1867.      until  you change them.  In edcompatible mode, when you
  1868.      explicitly give the name of a substitution option,  you
  1869.      will toggle the state of that option.
  1870.  
  1871.      This all seems very strange to me, but its  implementa-
  1872.      tion  was  almost free when I added the ":&" command to
  1873.      repeat the previous substitution, so there it is.
  1874.  
  1875. equalprg, ep
  1876.      This holds the name & arguments of the external  filter
  1877.      program  used  the  the visual = operator.  The default
  1878.      value is "fmt", so the  =  operator  will  adjust  line
  1879.      breaks in text.
  1880.  
  1881. errorbells, eb
  1882.      Elvis normally rings  a  bell  when  you  do  something
  1883.      wrong.  This option lets you disable the bell.
  1884.  
  1885. exrc This option specifies  whether  a  .exrc  file  in  the
  1886.      current directory should be executed.  By default, this
  1887.      option is off (":set noexrc") which prevents elvis from
  1888.      executing .exrc in the current directory.  If the .exrc
  1889.      file in your home directory turns this option on (":set
  1890.      exrc") then the Elvis will attempt to execute the .exrc
  1891.      file in the current directory.
  1892.  
  1893.      This option  exist  mainly  for  security  reasons.   A
  1894.      mean-spirited person could do something like
  1895.           echo >/tmp/.exrc '!rm -rf $HOME'
  1896.      and then anybody who attempted to edit or view  a  file
  1897.      in  the  /tmp directory would lose most of their files.
  1898.      With the exrc option turned off, this  couldn't  happen
  1899.      to you.
  1900.  
  1901. exrefresh, er
  1902.      The EX mode of Elvis writes many lines to  the  screen.
  1903.      You can make Elvis either write each line to the screen
  1904.      separately, or save up many lines and write them all at
  1905.  
  1906.  
  1907.  
  1908.                      November 30, 1993
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914. 5-5                       OPTIONS                        5-5
  1915.  
  1916.  
  1917.      once.
  1918.  
  1919.      The exrefresh option is normally on, so  each  line  is
  1920.      written to the screen separately.
  1921.  
  1922.      You may wish to turn  the  exrefresh  option  off  (:se
  1923.      noer)  if  the  "write"  system  call is costly on your
  1924.      machine, or if you're using  a  windowing  environment.
  1925.      (Windowing  environments  scroll text a lot faster when
  1926.      you write many lines at once.)
  1927.  
  1928.      This option has no effect in  visual  command  mode  or
  1929.      input mode.
  1930.  
  1931. flash, vbell
  1932.      If your termcap entry describes a  visible  alternative
  1933.      to  ringing your terminal's bell, then this option will
  1934.      say whether the visible version gets used or not.  Nor-
  1935.      mally it will be.
  1936.  
  1937.      If your termcap does NOT include a visible  bell  capa-
  1938.      bility,  then  the  flash  option  will be off, and you
  1939.      can't turn it on.
  1940.  
  1941. flipcase, fc
  1942.      The flipcase option allows you to control how the  non-
  1943.      ASCII characters are altered by the "~" command.
  1944.  
  1945.      The string is divided into pairs of  characters.   When
  1946.      "~" is applied to a non-ASCII character, Elvis looks up
  1947.      the character in the flipcase string to see which  pair
  1948.      it's  in, and replaces it by the other character of the
  1949.      pair.
  1950.  
  1951. hideformat, hf
  1952.      Many text formatters require you to embed  format  com-
  1953.      mands  in  your  text,  on  lines that start with a "."
  1954.      character.  Elvis normally displays  these  lines  like
  1955.      any  other  text,  but  if the hideformat option is on,
  1956.      then format lines are displayed as blank lines.
  1957.  
  1958. ignorecase, ic
  1959.      Normally, when  Elvis  searches  for  text,  it  treats
  1960.      uppercase  letters  as  being  different  for lowercase
  1961.      letters.
  1962.  
  1963.      When the ignorecase option is on, uppercase and  lower-
  1964.      case are treated as equal.
  1965.  
  1966. inputmode, im
  1967.      This option allows you to have Elvis start up in insert
  1968.      mode.   You  can  still exit insert mode at any time by
  1969.      hitting the ESC key, as usual.   Usually,  this  option
  1970.      would be set in your ".exrc" file.
  1971.  
  1972.  
  1973.  
  1974.                      November 30, 1993
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980. 5-6                       OPTIONS                        5-6
  1981.  
  1982.  
  1983. keytime, kt
  1984.      The arrow keys of most terminals send a multi-character
  1985.      sequence.   It  takes  a  measurable amount of time for
  1986.      these sequences to be transmitted.  The keytime  option
  1987.      allows  you  to  control  the maximum amount of time to
  1988.      allow for an arrow key (or  other  mapped  key)  to  be
  1989.      received in full.
  1990.  
  1991.      On most systems, the setting is the number of tenths of
  1992.      a  second  to  allow between characters.  On some other
  1993.      systems, the setting is in whole seconds.
  1994.  
  1995.      Try to avoid  setting  keytime=1.   Most  systems  just
  1996.      count  clock beats, so if you tried to read a character
  1997.      shortly before a clock beat, you could allow almost  no
  1998.      time  at  all  for  reading the characters.  For higher
  1999.      keytime settings, the difference is less critical.
  2000.  
  2001.      If your system's response time is poor, you might  want
  2002.      to  increase  the  keytime.   In particular, I've found
  2003.      that when keystrokes must be  sent  through  a  network
  2004.      (via  X  windows,  rlogin,  or telnet, for example) the
  2005.      keytime should be set to at least 1 second.
  2006.  
  2007.      As a special case, you can set keytime to 0 to  disable
  2008.      this time limit stuff altogether.  The big problem here
  2009.      is: If your arrow keys' sequences start  with  an  ESC,
  2010.      then every time you hit your ESC key Elvis will wait...
  2011.      and wait...  to see if maybe that ESC was  part  of  an
  2012.      arrow key's sequence.
  2013.  
  2014.      NOTE: this option is a generalization  of  the  timeout
  2015.      option of the real vi.
  2016.  
  2017. keywordprg, kp
  2018.      Elvis has a special keyword lookup feature.   You  move
  2019.      the cursor onto a word, and hit shift-K, and Elvis uses
  2020.      another program to look up the word and display  infor-
  2021.      mation about it.
  2022.  
  2023.      This option says which program gets run.
  2024.  
  2025.      The default value of this option is "ref", which  is  a
  2026.      program  that  looks up the definition of a function in
  2027.      C.  It looks up the function  name  in  a  file  called
  2028.      "refs" which is created by ctags.
  2029.  
  2030.      You can substitute other programs, such as  an  English
  2031.      dictionary  program  or  the online manual.  Elvis runs
  2032.      the program, using the keyword as  its  only  argument.
  2033.      The  program  should  write information to stdout.  The
  2034.      program's exit status should  be  0,  unless  you  want
  2035.      Elvis to print "<<< failed >>>".
  2036.  
  2037.  
  2038.  
  2039.  
  2040.                      November 30, 1993
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046. 5-7                       OPTIONS                        5-7
  2047.  
  2048.  
  2049. lines, ln
  2050.      This option says how many lines you screen has.
  2051.  
  2052. list, li
  2053.      In nolist mode (the default), Elvis displays text in  a
  2054.      "normal" manner -- with tabs expanded to an appropriate
  2055.      number of spaces, etc.
  2056.  
  2057.      However, sometimes it is useful to have tab  characters
  2058.      displayed   differently.    In   list  mode,  tabs  are
  2059.      displayed as "^I", and a "$" is displayed at the end of
  2060.      each line.
  2061.  
  2062. magic, ma
  2063.      The search  mechanism  in  Elvis  can  accept  "regular
  2064.      expressions"  --  strings  in  which certain characters
  2065.      have special meaning.
  2066.  
  2067.      The magic option is normally  on,  which  causes  these
  2068.      characters to be treated specially.
  2069.  
  2070.      If you turn the magic option off (:se noma),  then  all
  2071.      characters except ^ and $ are treated literally.  ^ and
  2072.      $ retain their special meanings regardless of the  set-
  2073.      ting of magic.
  2074.  
  2075. make, mk
  2076.      The :make  command  runs  your  "make"  program.   This
  2077.      option defines the name of your "make" program.
  2078.  
  2079. mesg With the  real  vi,  running  under  real  UNIX,  ":set
  2080.      nomesg" would prevent other users from sending you mes-
  2081.      sages.  Elvis ignores it, though.
  2082.  
  2083. modelines, ml
  2084.      Elvis supports modelines.  Modelines are lines near the
  2085.      beginning  or  end  of  your  text  file  which contain
  2086.      "ex:yowza:", where "yowza" is any EX command.  A  typi-
  2087.      cal  "yowza"  would  be  something  like  "set  ts=5 ca
  2088.      kp=spell wm=15".  Other text may also appear on a mode-
  2089.      line, so you can place the "ex:yowza:" in a comment:
  2090.  
  2091.              /* ex:set sw=4 ai: */
  2092.  
  2093.  
  2094.      Normally these lines are ignored, for security reasons,
  2095.      but if you have "set modelines" in your .exrc file then
  2096.      "yowza" is executed.
  2097.  
  2098. nearscroll, ns
  2099.      The line that contains the cursor will always be on the
  2100.      screen.  If you move the cursor to a line that isn't on
  2101.      the screen, then  elvis  will  either  scroll  (if  the
  2102.      cursor's  line  is  nearly  on  the  screen already) or
  2103.  
  2104.  
  2105.  
  2106.                      November 30, 1993
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112. 5-8                       OPTIONS                        5-8
  2113.  
  2114.  
  2115.      redraw the screen completely  with  the  cursor's  line
  2116.      centered  (if  the  cursor  line is not near the screen
  2117.      already).
  2118.  
  2119.      This option  allows  you  to  control  elvis'  idea  of
  2120.      "near".   A value of 15 is typical.  A value of 1 would
  2121.      cause elvis to scroll no more that one line.   A  value
  2122.      of 0 disables scrolling.
  2123.  
  2124. novice, nov
  2125.      The  command  ":set  novice"  is  equivalent  to  ":set
  2126.      nomagic report=1 showmode".
  2127.  
  2128. number, nu
  2129.      The  "number"  option  causes  Elvis  to  display  line
  2130.      numbers at the start of each line.  The numbers are not
  2131.      actually part of the text; when  the  file  is  written
  2132.      out, it will be written without line numbers.
  2133.  
  2134. paragraphs, pa
  2135.      The { and } commands move the cursor forward  or  back-
  2136.      ward in increments of one paragraph.  Paragraphs may be
  2137.      separated by blank lines, or by a "dot"  command  of  a
  2138.      text  formatter.   Different  text  formatters use dif-
  2139.      ferent "dot" commands.  This option allows you to  con-
  2140.      figure Elvis to work with your text formatter.
  2141.  
  2142.      It is assumed that your formatter  uses  commands  that
  2143.      start  with a "." character at the front of a line, and
  2144.      then have a one- or two-character command name.
  2145.  
  2146.      The value of the paragraphs option is a string in which
  2147.      each  pair  of  characters is one possible form of your
  2148.      text formatter's paragraph command.
  2149.  
  2150. more When Elvis must display a sequence of messages  at  the
  2151.      bottom  line  of the screen in visual mode, it normally
  2152.      pauses after all but the last one, so you have time  to
  2153.      read them all.
  2154.  
  2155.      If you turn off the "more" option, then Elvis will  not
  2156.      pause.   This means you can only read the last message,
  2157.      but it is usually the most important one anyway.
  2158.  
  2159. prompt, pr
  2160.      If you ":set noprompt", then Elvis will no longer  emit
  2161.      a  ':'  when  it  expects you to type in an ex command.
  2162.      This is slightly useful if you're  using  an  astonish-
  2163.      ingly  slow  UNIX  machine, but the rest of us can just
  2164.      ignore this one.
  2165.  
  2166. readonly, ro
  2167.      Normally, Elvis will let you write  back  any  file  to
  2168.      which  you  have  write  permission.  If you don't have
  2169.  
  2170.  
  2171.  
  2172.                      November 30, 1993
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178. 5-9                       OPTIONS                        5-9
  2179.  
  2180.  
  2181.      write permission, then you can only write  the  changed
  2182.      version of the file to a different file.
  2183.  
  2184.      If you set the readonly option, then Elvis will pretend
  2185.      you  don't  have write permission to any file you edit.
  2186.      It is useful when you really only mean to use Elvis  to
  2187.      look  at  a file, not to change it.  This way you can't
  2188.      change it accidentally.
  2189.  
  2190.      This option is normally off, unless you use the  "view"
  2191.      alias  of  Elvis.   "View" is like "vi" except that the
  2192.      readonly option is on.
  2193.  
  2194. remapThe ":map"  command  allows  you  to  convert  one  key
  2195.      sequence  into another.  The remap option allows you to
  2196.      specify what should happen if portions  of  that  other
  2197.      sequence  are  also  in the map table.  If remap is on,
  2198.      then those portions will also be  mapped,  just  as  if
  2199.      they  had been typed on the keyboard.  If remap is off,
  2200.      then the matching portions will not be mapped.
  2201.  
  2202.      For example, if you enter the commands ":map A  B"  and
  2203.      ":map  B C", then when remap is on, A will be converted
  2204.      to C.  But when remap is off, A will be converted  only
  2205.      to B.
  2206.  
  2207. report, re
  2208.      Commands in Elvis may affect many lines.  For  commands
  2209.      that affect a lot of lines, Elvis will output a message
  2210.      saying what was done and how many lines were  affected.
  2211.      This  option allows you to define what "a lot of lines"
  2212.      means.  The default is 5, so any command which  affects
  2213.      5 or more lines will cause a message to be shown.
  2214.  
  2215. ruler, ru
  2216.      This option is normally off.  If you turn it  on,  then
  2217.      Elvis  will  constantly display the line/column numbers
  2218.      of the cursor, at the bottom of the screen.
  2219.  
  2220. scroll, sc
  2221.      The ^U and ^D keys normally scroll backward or  forward
  2222.      by half a screenful, but this is adjustable.  The value
  2223.      of this option says how many lines  those  keys  should
  2224.      scroll  by.   If you invoke ^U or ^D with a count argu-
  2225.      ment (for example, "33^D") then this option's value  is
  2226.      set to the count.
  2227.  
  2228. sections, se
  2229.      The [[ and ]] commands move the cursor backward or for-
  2230.      ward  in increments of 1 section.  Sections may be del-
  2231.      imited by a { character in column 1  (which  is  useful
  2232.      for  C  source  code) or by means of a text formatter's
  2233.      "dot" commands.
  2234.  
  2235.  
  2236.  
  2237.  
  2238.                      November 30, 1993
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244. 5-10                      OPTIONS                       5-10
  2245.  
  2246.  
  2247.      This option allows you to configure Elvis to work  with
  2248.      your text formatter's "section" command, in exactly the
  2249.      same way that the paragraphs option makes it work  with
  2250.      the formatter's "paragraphs" command.
  2251.  
  2252. shell, sh
  2253.      When Elvis forks a shell (perhaps for the :! or  :shell
  2254.      commands)  this is the program that is uses as a shell.
  2255.      This is "/bin/sh" by default, unless you have  set  the
  2256.      SHELL (or COMSPEC, for MS-DOS) environment variable, it
  2257.      which  case  the  default  value  is  copied  from  the
  2258.      environment.
  2259.  
  2260. shiftwidth, sw
  2261.      The < and > commands shift text left or right  by  some
  2262.      uniform  number  of  columns.   The  shiftwidth  option
  2263.      defines that "uniform number".  The default is 8.
  2264.  
  2265. showmatch, sm
  2266.      With showmatch set, in input mode every  time  you  hit
  2267.      one  of  )}], Elvis will momentarily move the cursor to
  2268.      the matching ({[.
  2269.  
  2270. showmode, smd
  2271.      In visual mode, it is easy to forget whether you're  in
  2272.      the  visual  command  mode or input/replace mode.  Nor-
  2273.      mally, the showmode option is off, and  you  haven't  a
  2274.      clue  as  to  which  mode  you're  in.  If you turn the
  2275.      showmode option  on,  though,  a  little  message  will
  2276.      appear  in  the lower right-hand corner of your screen,
  2277.      telling you which mode you're in.
  2278.  
  2279. sidescroll, ss
  2280.      For long lines, Elvis scrolls sideways.  (This is  dif-
  2281.      ferent from the real vi, which wraps a single long line
  2282.      onto several rows of the screen.)
  2283.  
  2284.      To minimize the number of scrolls needed,  Elvis  moves
  2285.      the  screen  sideways  by several characters at a time.
  2286.      The value of this  option  says  how  many  characters'
  2287.      widths to scroll at a time.
  2288.  
  2289.      Generally, the faster your screen can be  redrawn,  the
  2290.      lower the value you will want in this option.
  2291.  
  2292. sync, sy
  2293.      If the system crashes during an edit session, then most
  2294.      of  your  work can be recovered from the temporary file
  2295.      that Elvis uses to store changes.   However,  sometimes
  2296.      the  OS  will not copy changes to the hard disk immedi-
  2297.      ately, so recovery might not be possible.  The [no]sync
  2298.      option lets you control this.
  2299.  
  2300.      In nosync mode (which is the default, for UNIX),  Elvis
  2301.  
  2302.  
  2303.  
  2304.                      November 30, 1993
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310. 5-11                      OPTIONS                       5-11
  2311.  
  2312.  
  2313.      lets  the operating system control when data is written
  2314.      to the disk.  This is generally faster.
  2315.  
  2316.      In sync mode (which is the default for  MS-DOS,  Amiga-
  2317.      Dos,  and  Atari  TOS), Elvis forces all changes out to
  2318.      disk every time you make a change.  This  is  generally
  2319.      safer,  but slower.  It can also be a rather rude thing
  2320.      to do on a multi-user system.
  2321.  
  2322. tabstop, ts
  2323.      Tab characters are normally 8 characters wide, but  you
  2324.      can change their widths by means of this option.
  2325.  
  2326. taglength, tl
  2327.      This option allows you to specify how  many  characters
  2328.      of  a tag's name must match when performing tag lookup.
  2329.      As a special case, ":set taglength=0"  means  that  all
  2330.      characters of a tag's name must match.
  2331.  
  2332.      Note: some configurations of Elvis don't  support  this
  2333.      option.
  2334.  
  2335. tags, tag
  2336.      If   your   version   of   elvis   is   compiled   with
  2337.      -DINTERNAL_TAGS, then this is a space-delimited list of
  2338.      tags files.  When you tell elvis to look up a  tag,  it
  2339.      searches  though  each  file in turn until it finds the
  2340.      tag.
  2341.  
  2342.      If  your  version  of   elvis   is   compiled   without
  2343.      -DINTERNAL_TAGS,  then  you can achieve the same effect
  2344.      via an environment variable called TAGPATH.   TAGPATH's
  2345.      value  is  a  colon-delimited list of file or directory
  2346.      names.  (For some operating systems, including  MS-DOS,
  2347.      the list is delimited by semicolons instead of colons.)
  2348.  
  2349. tagstack
  2350.      This option allows you  to  disable  the  tagstack.   I
  2351.      can't  think  of  any  reason  why you would want to do
  2352.      that.
  2353.  
  2354. term, te
  2355.      This read-only option shows the  name  of  the  termcap
  2356.      entry that Elvis is using for your terminal.
  2357.  
  2358. terse, tr
  2359.      The real vi uses  this  option  to  select  longer  vs.
  2360.      shorter  error  messages.   Elvis  has  only one set of
  2361.      error messages, though, so this option has no effect.
  2362.  
  2363. timeout, to
  2364.      The command ":set notimeout"  is  equivalent  to  ":set
  2365.      keytime=0",  and  ":set timeout" is equivalent to ":set
  2366.      keytime=1".  This affects the  behavior  of  the  <Esc>
  2367.  
  2368.  
  2369.  
  2370.                      November 30, 1993
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376. 5-12                      OPTIONS                       5-12
  2377.  
  2378.  
  2379.      key.   See  the  discussion of the "keytime" option for
  2380.      more information.
  2381.  
  2382. warn, wa
  2383.      If you have modified a file but not yet written it back
  2384.      to  disk,  then  Elvis  will  normally  print a warning
  2385.      before executing a ":!cmd" command.  However, in nowarn
  2386.      mode, this warning is not given.
  2387.  
  2388.      Elvis also normally prints a message after a successful
  2389.      search  that  wrapped  at EOF.  The [no]warn option can
  2390.      also disable this warning.
  2391.  
  2392. window, wi
  2393.      This option controls how many lines are redrawn after a
  2394.      long move.
  2395.  
  2396.      On fast terminals, this is usually set to the number of
  2397.      rows  that  the  terminal can display, minus one.  This
  2398.      causes the entire screen to be filled with text  around
  2399.      the cursor.
  2400.  
  2401.      On slow terminals, you may wish to reduce this value to
  2402.      about  7  or  so.   That way, if you're doing something
  2403.      like  repeatedly  hitting  'n'  to  search   for   each
  2404.      occurrence of some string and trying to find a particu-
  2405.      lar occurrence, then you don't need to wait as long for
  2406.      Elvis to redraw the screen after each search.
  2407.  
  2408. wrapmargin, wm
  2409.      Normally (with wrapmargin=0) Elvis will let you type in
  2410.      extremely long lines, if you wish.
  2411.  
  2412.      However, with warpmargin set to something other that  0
  2413.      (wrapmargin=10 is nice), Elvis will automatically cause
  2414.      long lines to be "wrapped" on a word  break  for  lines
  2415.      come  too close to the right-hand margin.  For example:
  2416.      On an 80-column screen, ":set wm=10" will  cause  lines
  2417.      to wrap when their length exceeds 70 columns.
  2418.  
  2419. wrapscan, ws
  2420.      Normally, when you search  for  something,  Elvis  will
  2421.      find  it  no  matter  where  it  is in the file.  Elvis
  2422.      starts at the cursor position,  and  searches  forward.
  2423.      If  Elvis  hits EOF without finding what you're looking
  2424.      for, then it wraps around to  continue  searching  from
  2425.      line  1.   If  you  turn  off  the wrapscan option (:se
  2426.      nows), then when Elvis hits EOF  during  a  search,  it
  2427.      will stop and say so.
  2428.  
  2429. writeany, wr
  2430.      With "writeany" turned off, elvis will prevent you from
  2431.      accidentally overwriting a file.  For example, if "foo"
  2432.      exists then ":w foo" will fail.  If  you  turn  on  the
  2433.  
  2434.  
  2435.  
  2436.                      November 30, 1993
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442. 5-13                      OPTIONS                       5-13
  2443.  
  2444.  
  2445.      "writeany" option, then ":w foo" will work.
  2446.  
  2447.      Regardless of the setting of "writeany",  though,  ":w!
  2448.      foo"  will  work.   The  '!' forces the ":w" command to
  2449.      write the file unless the operating system won't  allow
  2450.      it.
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.                      November 30, 1993
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511. 6.  CUT BUFFERS
  2512.  
  2513.      When Elvis deletes text, it stores that text in  a  cut
  2514. buffer.   This  happens  in  both  visual  mode and EX mode.
  2515. There is no practical limit to how much text  a  cut  buffer
  2516. can hold.
  2517.  
  2518.      There are 36 cut buffers: 26 named buffers ("a  through
  2519. "z),  9  anonymous  buffers ("1 through "9), and 1 extra cut
  2520. buffer (".).
  2521.  
  2522.      In EX mode, the :move and  :copy  commands  use  a  cut
  2523. buffer to temporarily hold the text to be moved/copied.
  2524.  
  2525. 6.1.  Putting text into a Cut Buffer
  2526.  
  2527.      In visual mode, text is copied into a cut  buffer  when
  2528. you  use the d, y, c, C, s, or x commands.  There are also a
  2529. few others.
  2530.  
  2531.      By default, the text goes into the "1 buffer.  The text
  2532. that  used to be in "1 gets shifted into "2, "2 gets shifted
  2533. into "3, and so on.  The text that used to be in "9 is lost.
  2534. This  way,  the last 9 things you deleted are still accessi-
  2535. ble.
  2536.  
  2537.      You can also put the text into a  named  buffer  --  "a
  2538. through  "z.   To do this, you should type the buffer's name
  2539. (two keystrokes: a  double-quote  and  a  lowercase  letter)
  2540. before  the  command  that  will  cut the text.  When you do
  2541. this, "1 through "9 are not affected by the cut.
  2542.  
  2543.      You can append text to one of the named buffers.  To do
  2544. this,  type  the  buffer's name in uppercase (a double-quote
  2545. and an uppercase letter) before the d/y/c/C/s/x command.
  2546.  
  2547.      The ". buffer is special.  It  isn't  affected  by  the
  2548. d/y/c/C/s/x  command.   Instead, it stores the text that you
  2549. typed in the last time you were in input mode.  It  is  used
  2550. to implement the . visual command, and ^A in input mode.
  2551.  
  2552.      In EX mode (also known as  colon  mode),  the  :delete,
  2553. :change, and :yank commands all copy text into a cut buffer.
  2554. Like the visual commands, these EX commands normally use the
  2555. "1  buffer, but you can use one of the named buffers by giv-
  2556. ing its name after the command.  For example,
  2557.  
  2558.      :20,30y a
  2559.  
  2560.  
  2561. will copy lines 20 through 30 into cut buffer "a.
  2562.  
  2563.      You can't directly put text into the ". buffer, or  the
  2564. "2 through "9 buffers.
  2565.  
  2566.  
  2567.  
  2568.                      November 30, 1993
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574. 6-2                     CUT BUFFERS                      6-2
  2575.  
  2576.  
  2577. 6.2.  Pasting from a Cut Buffer
  2578.  
  2579.      There  are  two  styles  of  pasting:   line-mode   and
  2580. character-mode.   If a cut buffer contains whole lines (from
  2581. a command like "dd") then line-mode pasting is used;  if  it
  2582. contains  partial  lines  (from  a  command  like "dw") then
  2583. character-mode pasting is used.  The EX commands always  cut
  2584. whole lines.
  2585.  
  2586.      Character-mode pasting causes the text to  be  inserted
  2587. into the line that the cursor is on.
  2588.  
  2589.      Line-mode pasting inserts the text on a new line  above
  2590. or  below the line that the cursor is on.  It doesn't affect
  2591. the cursor's line at all.
  2592.  
  2593.      In visual mode, the p and P commands insert text from a
  2594. cut  buffer.   Uppercase P will insert it before the cursor,
  2595. and lowercase p will insert it after the cursor.   Normally,
  2596. these  commands  will  paste from the "1 buffer, but you can
  2597. specify any other buffer to paste from.  Just type its  name
  2598. (a double-quote and another character) before you type the P
  2599. or p.
  2600.  
  2601.      In EX mode, the (pu)t command pastes text after a given
  2602. line.   To paste from a buffer other that "1, enter its name
  2603. after the command.
  2604.  
  2605. 6.3.  Macros
  2606.  
  2607.      The contents of a named cut buffer can be executed as a
  2608. series of ex/vi commands.
  2609.  
  2610.      To put the instructions into the cut buffer,  you  must
  2611. first insert them into the file, and then delete them into a
  2612. named cut buffer.
  2613.  
  2614.      To execute a cut buffer's contents as EX commands,  you
  2615. should  give  the EX command "@" and the name of the buffer.
  2616. For example, :@z will execute "z as a series of EX commands.
  2617.  
  2618.      To execute a cut buffer's contents as visual  commands,
  2619. you should give the visual command "@" and the letter of the
  2620. buffer's name.  The visual "@" command is different from the
  2621. EX  "@"  command.   They interpret the cut buffer's contents
  2622. differently.
  2623.  
  2624.      The visual @ command can be rather finicky.  Each char-
  2625. acter  in  the buffer is interpreted as a keystroke.  If you
  2626. load the instructions into the cut buffer via  a  "zdd  com-
  2627. mand, then the newline character at the end of the line will
  2628. be executed just like any other  character,  so  the  cursor
  2629. would be moved down 1 line.  If you don't want the cursor to
  2630. move down 1 line at the end of each  @z  command,  then  you
  2631.  
  2632.  
  2633.  
  2634.                      November 30, 1993
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640. 6-3                     CUT BUFFERS                      6-3
  2641.  
  2642.  
  2643. should load the cut buffer by saying 0"zD instead.
  2644.  
  2645.      Although cut buffers can hold any amount of text, Elvis
  2646. can  only  execute small buffers.  The size limit is roughly
  2647. 1000 characters, for either EX macros or VI  macros.   If  a
  2648. buffer  is  too  large  to  execute,  an  error  message  is
  2649. displayed.
  2650.  
  2651.      You can't nest :@ commands.  You can't run :@  commands
  2652. from  your  .exrc  file,  or  any other :source file either.
  2653. Similarly, you can't run a :source command from within an  @
  2654. command.   Hopefully, these restrictions will be lifted in a
  2655. later version.
  2656.  
  2657. 6.4.  The Effect of Switching Files
  2658.  
  2659.      When Elvis first starts up, all cut buffers are  empty.
  2660. When  you  switch to a different file (via the :n or :e com-
  2661. mands perhaps) the  9  anonymous  cut  buffers  are  emptied
  2662. again,  but  the  other  27  buffers ("a through "z, and ".)
  2663. retain their text.
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.                      November 30, 1993
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709. 7.  DIFFERENCES BETWEEN Elvis & BSD VI/EX
  2710.  
  2711.      Elvis is not  100%  compatible  with  the  real  vi/ex.
  2712. Elvis  has  many small extensions, some omissions, and a few
  2713. features which  are  implemented  in  a  slightly  different
  2714. manner.
  2715.  
  2716. 7.1.  Extensions
  2717.  
  2718. Save Configuration
  2719.           The :mkexrc command saves the current :set,  :map,
  2720.           :ab,  :color,  and  :digraph configurations in the
  2721.           ".exrc" file in your current directory.
  2722.  
  2723. Previous File
  2724.           The :N or :prev command  moves  backwards  through
  2725.           the args list.
  2726.  
  2727. Center Current Row
  2728.           In visual command mode, the (lowercase) "zz"  com-
  2729.           mand  will  center the current line on the screen,
  2730.           like "z=".
  2731.  
  2732. Changing Repeat Count
  2733.           The default count value for . is the same  as  the
  2734.           previous command which . is meant to repeat.  How-
  2735.           ever, you can supply a new count if you wish.  For
  2736.           example, after "3dw", "." will delete 3 words, but
  2737.           "5." will delete 5 words.
  2738.  
  2739. Previous Text
  2740.           The text which was most recently input (via a "cw"
  2741.           command,  or  something similar) is saved in a cut
  2742.           buffer called ". (which is a pretty hard  name  to
  2743.           write in an English sentence).
  2744.  
  2745. Keyword Lookup
  2746.           In visual command mode, you can  move  the  cursor
  2747.           onto  a word and press shift-K to have Elvis run a
  2748.           reference program to look that word up.  This com-
  2749.           mand  alone  is worth the price of admission!  See
  2750.           the ctags and ref programs.
  2751.  
  2752. Increment/Decrement
  2753.           In visual command mode, you can  move  the  cursor
  2754.           onto  a  number and then hit ## or #+ to increment
  2755.           that number by 1.  To increment  it  by  a  larger
  2756.           amount, type in the increment value before hitting
  2757.           the initial #.  The number can also be decremented
  2758.           or set by hitting #- or #=, respectively.
  2759.  
  2760. Input ModeYou can backspace past the beginning of the line.
  2761.  
  2762.           The arrow keys work in input mode.
  2763.  
  2764.  
  2765.  
  2766.                      November 30, 1993
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772. 7-2        DIFFERENCES BETWEEN Elvis & BSD VI/EX         7-2
  2773.  
  2774.  
  2775.           If you type control-A,  then  the  text  that  you
  2776.           input  last  time is inserted.  You will remain in
  2777.           input mode, so you can backspace over part of  it,
  2778.           or  add  more  to  it.   (This  is  sort  of  like
  2779.           control-@ on the real vi,  except  that  control-A
  2780.           really works.)
  2781.  
  2782.           Control-P will insert  the  contents  of  the  cut
  2783.           buffer.
  2784.  
  2785.           Real vi can only remember up to 128 characters  of
  2786.           input, but Elvis can remember any amount.
  2787.  
  2788.           The ^T and ^D keys can adjust the indent of a line
  2789.           no  matter  where the cursor happens to be in that
  2790.           line.
  2791.  
  2792.           You can save your file  and  exit  Elvis  directly
  2793.           from input mode by hitting control-Z twice.
  2794.  
  2795.           Elvis supports digraphs as a  way  to  enter  non-
  2796.           ASCII characters.
  2797.  
  2798. Start in Input Mode
  2799.           If you ":set inputmode" in your .exrc  file,  then
  2800.           Elvis  will  start  up  in  input  mode instead of
  2801.           visual command mode.
  2802.  
  2803. Visible Fonts
  2804.           With   ":set   charattr",   Elvis   can    display
  2805.           "backslash-f"  style  character  attributes on the
  2806.           screen as you edit.  The following  example  shows
  2807.           the recognized attributes:
  2808.  
  2809.                normal      \fBboldface\fR      \fIitalics\fR
  2810.           \fUunderlined\fR normal
  2811.  
  2812.           NOTE:  you  must   compile   Elvis   without   the
  2813.           -DNO_CHARATTR flag for this to work.
  2814.  
  2815. File Syncing
  2816.           After a crash, you can usually recover the altered
  2817.           form  of  the  file  from  the temporary file that
  2818.           Elvis uses -- unless the temporary file  was  cor-
  2819.           rupted.
  2820.  
  2821.           UNIX systems  use  a  delayed-write  cache,  which
  2822.           means  that  when Elvis tries to write to the tem-
  2823.           porary file, the information might still be in RAM
  2824.           instead  of  on the disk.  A power failure at that
  2825.           time would cause  the  in-RAM  information  to  be
  2826.           lost.   UNIX's  sync()  call  will  force all such
  2827.           information to disk.
  2828.  
  2829.  
  2830.  
  2831.  
  2832.                      November 30, 1993
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838. 7-3        DIFFERENCES BETWEEN Elvis & BSD VI/EX         7-3
  2839.  
  2840.  
  2841.           MS-DOS and Atari TOS don't write a  file's  length
  2842.           to  disk until that file is closed.  Consequently,
  2843.           the temporary file would appear to be 0 bytes long
  2844.           if  power  failed  when we were editing.  To avoid
  2845.           this problem, a sync() function has  been  written
  2846.           which  will  close  the  temporary  file  and then
  2847.           immediately reopen it.
  2848.  
  2849. Cursor Shape
  2850.           Elvis changes the shape of the cursor to  indicate
  2851.           which  mode  you're in, if your terminal's termcap
  2852.           entry includes the necessary capabilities.
  2853.  
  2854. Hide nroff Lines
  2855.           The ":set hideformat" option  hides  nroff  format
  2856.           control  lines.  (They are displayed on the screen
  2857.           as blank lines.)
  2858.  
  2859. Compiler Interface
  2860.           Elvis is clever enough to parse the error messages
  2861.           emitted  by  many compilers.  To use this feature,
  2862.           you should collect your compiler's error  messages
  2863.           into a file called "errlist"; Elvis will read this
  2864.           file, determine which source file caused the error
  2865.           messages, start editing that file, move the cursor
  2866.           to the line where  the  error  was  detected,  and
  2867.           display  the  error  message  on  the status line.
  2868.           Nifty!
  2869.  
  2870. Visible Text Selection
  2871.           In visual command mode, 'v' starts visibly select-
  2872.           ing  characters  and  'V' starts visibly selecting
  2873.           whole lines.  The character or line where the cur-
  2874.           sor  is located becomes one endpoint of the selec-
  2875.           tion.  You can then use the standard cursor  move-
  2876.           ment commands to move the cursor to the other end-
  2877.           point, and then press one of the operator commands
  2878.           (c/d/y/</>/!/=/\).  The operator will then immedi-
  2879.           ately be applied to the selected text.
  2880.  
  2881. Pop-up Menu Operator
  2882.           The '\' key is a new operator, similar  in  opera-
  2883.           tion to the c/d/y/</>/! operators.  It conjures up
  2884.           a menu, from which you can select any of the other
  2885.           operators plus a few other common commands.
  2886.  
  2887. Preset Filter Operator
  2888.           The '=' key is another new operator.  It is  simi-
  2889.           lar  to  the  '!'  operator, except that while '!'
  2890.           asks you to type in a filter  command  each  time,
  2891.           '='  assumes  it  should  always  run  the command
  2892.           stored in the equalprg option.
  2893.  
  2894. Move to a Given Percentage
  2895.  
  2896.  
  2897.  
  2898.                      November 30, 1993
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904. 7-4        DIFFERENCES BETWEEN Elvis & BSD VI/EX         7-4
  2905.  
  2906.  
  2907.           The '%' movement key can now  accept  an  optional
  2908.           count.   Without  a count, the '%' key still moves
  2909.           to a matching  parenthesis  like  it  always  did.
  2910.           With  a count somewhere between 1 and 100, though,
  2911.           it moves the cursor to approximately a given  per-
  2912.           centage of the way through the file.  For example,
  2913.           typing "50%" will move the cursor to the middle of
  2914.           the file.
  2915.  
  2916. Regular Expressions
  2917.           In regular expressions, several new forms of  clo-
  2918.           sure  operators  are  supported: \{n}, \{n,m}, \+,
  2919.           and \?.
  2920.  
  2921. 7.2.  Omissions
  2922.  
  2923.      The replace mode is a hack.  It doesn't save  the  text
  2924. that it overwrites.
  2925.  
  2926.      Long lines are displayed differently -- where the  real
  2927. vi  would  wrap a long line onto several rows of the screen,
  2928. Elvis simply displays part of the line, and  allows  you  to
  2929. scroll the screen sideways to see the rest of it.
  2930.  
  2931.      The ":preserve" and ":recover"  commands  are  missing.
  2932. So  is  the  -r  flag.   I've never had a good reason to use
  2933. ":preserve", and  since  ":recover"  is  used  so  rarely  I
  2934. decided  to  implement it as a separate program.  There's no
  2935. need to load the recovery code into memory  every  time  you
  2936. edit a file, I figured.
  2937.  
  2938.      LISP support is missing.  However, the = key  is  still
  2939. an  operator  that  reformats lines of text.  By default, it
  2940. reformats lines by sending them through the fmt filter,  but
  2941. you could write your own LISP beautifier and configure elvis
  2942. to use it.  Key mappings  could  take  care  of  most  other
  2943. differences.  Auto-indent is the only thing that is irrecov-
  2944. erably lost.
  2945.  
  2946.      Autoindent mode acts a little different from  the  real
  2947. vi, anyway.  It doesn't handle ^^D or 0^D correctly.  On the
  2948. other hand, it does allow ^D and ^T to be used  anywhere  in
  2949. the line, to adjust the indentation for the whole line.
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.                      November 30, 1993
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973. 8.  INTERNAL
  2974.  
  2975.      You don't need to know the material in this section  to
  2976. use Elvis.  You only need it if you intend to modify Elvis.
  2977.  
  2978.      You should also check out the CFLAGS, TERMCAP, ENVIRON-
  2979. MENT  VARIABLES, VERSIONS, and QUIESTIONS & ANSWERS sections
  2980. of this manual.
  2981.  
  2982. 8.1.  The temporary file
  2983.  
  2984.      The temporary file is divided into blocks of 1024 bytes
  2985. each.  The functions in "blk.c" maintain a cache of the five
  2986. most recently used blocks, to minimize file I/O.
  2987.  
  2988.      When Elvis starts up, the file is copied into the  tem-
  2989. porary  file  by  the function tmpstart() in "tmp.c".  Small
  2990. amounts of extra space are inserted into the temporary  file
  2991. to  insure  that no text lines cross block boundaries.  This
  2992. speeds up processing and simplifies storage management.  The
  2993. extra  space  is filled with NUL characters.  the input file
  2994. must not contain any NULs, to avoid  confusion.   This  also
  2995. limits lines to a length of 1023 characters or less.
  2996.  
  2997.      The data blocks aren't necessarily stored in  sequence.
  2998. For  example,  it  is  entirely possible that the data block
  2999. containing the first lines of text will be stored after  the
  3000. block containing the last lines of text.
  3001.  
  3002.      In RAM, Elvis maintains two lists: one  that  describes
  3003. the  "proper"  order  of  the  disk blocks, and another that
  3004. records the line number of the  last  line  in  each  block.
  3005. When  Elvis  needs  to  fetch  a given line of text, it uses
  3006. these tables to locate the data block  which  contains  that
  3007. line.
  3008.  
  3009.      Before each change is made to the file, these lists are
  3010. copied.  The copies can be used to "undo" the change.  Also,
  3011. the first list -- the one that  lists  the  data  blocks  in
  3012. their  proper order -- is written to the first data block of
  3013. the temp file.  This list can be used during file recovery.
  3014.  
  3015.      When blocks are altered, they are rewritten to  a  dif-
  3016. ferent  block  in  the  file,  and the order list is updated
  3017. accordingly.  The original block is  left  intact,  so  that
  3018. "undo"  can  be  performed  easily.   Elvis  will eventually
  3019. reclaim the original block, when it is no longer needed.
  3020.  
  3021. 8.2.  Implementation of Editing
  3022.  
  3023.      There are three basic operations which affect text:
  3024.  
  3025.         + delete text   - delete(from, to)
  3026.         + add text      - add(at, text)
  3027.  
  3028.  
  3029.  
  3030.                      November 30, 1993
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036. 8-2                       INTERNAL                       8-2
  3037.  
  3038.  
  3039.         + yank text     - cut(from, to)
  3040.  
  3041.  
  3042.      To yank text, all text between two  text  positions  is
  3043. copied into a cut buffer.  The original text is not changed.
  3044. To copy the text into a cut buffer, you need  only  remember
  3045. which  physical blocks that contain the cut text, the offset
  3046. into the first block of the start of  the  cut,  the  offset
  3047. into  the last block of the end of the cut, and what kind of
  3048. cut it was.  (Cuts may be  either  character  cuts  or  line
  3049. cuts;  the kind of a cut affects the way it is later "put".)
  3050. Yanking is implemented in the function cut(), and pasting is
  3051. implemented  in  the  function paste().  These functions are
  3052. defined in "cut.c".
  3053.  
  3054.      To delete text, you must  modify  the  first  and  last
  3055. blocks,  and  remove any reference to the intervening blocks
  3056. in the header's list.  The text to be deleted  is  specified
  3057. by two marks.  This is implemented in the function delete().
  3058.  
  3059.      To add text, you must specify the text to insert (as  a
  3060. NUL-terminated  string)  and  the  place  to insert it (as a
  3061. mark).  The block into which the text is to be inserted  may
  3062. need  to  be  split  into  as  many as four blocks, with new
  3063. intervening blocks needed as well...  or it could be as sim-
  3064. ple as modifying a single block.  This is implemented in the
  3065. function add().
  3066.  
  3067.      There is also a change() function, which generally just
  3068. calls delete() and add().  For the special case where a sin-
  3069. gle character is being replaced by another single character,
  3070. though,  change() will optimize things somewhat.  The add(),
  3071. delete(),  and  change()  functions  are  all   defined   in
  3072. "modify.c".
  3073.  
  3074.      The input() function reads text from a user and inserts
  3075. it  into  the  file.   It  makes  heavy  use  of  the add(),
  3076. delete(), and change() functions.  It inserts characters one
  3077. at a time, as they are typed.
  3078.  
  3079.      When  text  is  modified,  an  internal   file-revision
  3080. counter,  called  changes,  is incremented.  This counter is
  3081. used to detect when certain caches are out  of  date.   (The
  3082. "changes"  counter  is  also incremented when we switch to a
  3083. different file, and also in one or two similar situations --
  3084. all related to invalidating caches.)
  3085.  
  3086. 8.3.  Marks and the Cursor
  3087.  
  3088.      Marks are places within the text.  They are represented
  3089. internally  as  32-bit  values which are split into two bit-
  3090. fields: a line number and a character index.   Line  numbers
  3091. start with 1, and character indexes start with 0.  Lines can
  3092. be up to 1023 characters long, so the character index is  10
  3093.  
  3094.  
  3095.  
  3096.                      November 30, 1993
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102. 8-3                       INTERNAL                       8-3
  3103.  
  3104.  
  3105. bits wide and the line number fills the remaining 22 bits in
  3106. the long int.
  3107.  
  3108.      Since line numbers start with 1, it is impossible for a
  3109. valid  mark  to have a value of 0L.  0L is therefore used to
  3110. represent unset marks.
  3111.  
  3112.      When you do the "delete text" change,  any  marks  that
  3113. were  part of the deleted text are unset, and any marks that
  3114. were set  to  points  after  it  are  adjusted.   Marks  are
  3115. adjusted similarly after new text is inserted.
  3116.  
  3117.      The cursor is represented as a mark.
  3118.  
  3119. 8.4.  Colon Command Interpretation
  3120.  
  3121.      Colon commands are parsed,  and  the  command  name  is
  3122. looked  up  in  an  array of structures which also contain a
  3123. pointer to the function that implements the command,  and  a
  3124. description  of the arguments that the command can take.  If
  3125. the command is recognized and its arguments are legal,  then
  3126. the function is called.
  3127.  
  3128.      Each function performs its task;  this  may  cause  the
  3129. cursor to be moved to a different line, or whatever.
  3130.  
  3131. 8.5.  Screen Control
  3132.  
  3133.      In input mode or visual command  mode,  the  screen  is
  3134. redrawn  by  a  function  called redraw().  This function is
  3135. called in the getkey() function  before  each  keystroke  is
  3136. read in, if necessary.
  3137.  
  3138.      Redraw() writes to the screen via a package which looks
  3139. like  the  "curses" library, but isn't.  It is actually much
  3140. simpler.  Most curses operations are implemented  as  macros
  3141. which copy characters into a large I/O buffer, which is then
  3142. written with a single large write()  call  as  part  of  the
  3143. refresh() operation.
  3144.  
  3145.      (Note: Under MS-DOS, the pseudo-curses macros check  to
  3146. see  whether you're using the pcbios interface.  If you are,
  3147. then the macros call functions in "pc.c" to implement screen
  3148. updates.)
  3149.  
  3150.      The  low-level  functions  which  modify  text  (namely
  3151. add(), delete(), and change()) supply redraw() with clues to
  3152. help redraw() decide which  parts  of  the  screen  must  be
  3153. redrawn.    The  clues  are  given  via  a  function  called
  3154. redrawrange().
  3155.  
  3156.      Most EX commands use the pseudo-curses package to  per-
  3157. form their output, like redraw().
  3158.  
  3159.  
  3160.  
  3161.  
  3162.                      November 30, 1993
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168. 8-4                       INTERNAL                       8-4
  3169.  
  3170.  
  3171.      There is also a function called msg()  which  uses  the
  3172. same  syntax  as printf().  In EX mode, msg() writes message
  3173. to the screen and automatically adds a newline.  In VI mode,
  3174. msg()  writes  the  message on the bottom line of the screen
  3175. with the "standout" character attribute turned on.
  3176.  
  3177. 8.6.  Options
  3178.  
  3179.      For each option available through the  ":set"  command,
  3180. Elvis contains a character array variable, named "o_option".
  3181. For example, the  "lines"  option  uses  a  variable  called
  3182. "o_lines".
  3183.  
  3184.      For boolean options, the array has a  dimension  of  1.
  3185. The  first  (and only) character of the array will be NUL if
  3186. the variable's value is FALSE, and some other value if it is
  3187. TRUE.   To  check  the  value, just by dereference the array
  3188. name, as in "if (*o_autoindent)".
  3189.  
  3190.      For number options, the array has  a  dimension  of  3.
  3191. The  array  is  treated as three unsigned one-byte integers.
  3192. The first byte is the current  value  of  the  option.   The
  3193. second  and  third  bytes  are the lower and upper bounds of
  3194. that option.
  3195.  
  3196.      For string options, the array usually has  a  dimension
  3197. of about 60 but this may vary.  The option's value is stored
  3198. as a normal NUL-terminated string.
  3199.  
  3200.      All of the options are declared in "opts.c".  Most  are
  3201. initialized to their default values; the initopts() function
  3202. is used to perform any environment-specific initialization.
  3203.  
  3204. 8.7.  Portability
  3205.  
  3206.      To improve portability, Elvis collects as many  of  the
  3207. system-dependent definitions as possible into the "config.h"
  3208. file.  This file begins with some preprocessor  instructions
  3209. which attempt to determine which compiler and operating sys-
  3210. tem you have.  After that,  it  conditionally  defines  some
  3211. macros and constants for your system.
  3212.  
  3213.      One of the more significant macros is ttyread().   This
  3214. macro is used to read raw characters from the keyboard, pos-
  3215. sibly with timeout.  For UNIX systems, this basically  reads
  3216. bytes  from  stdin.  For MSDOS, TOS, and OS9, ttyread() is a
  3217. function defined in curses.c.  There is  also  a  ttywrite()
  3218. macro.
  3219.  
  3220.      The tread() and twrite() macros are versions of  read()
  3221. and  write() that are used for text files.  On UNIX systems,
  3222. these are equivalent to  read()  and  write().   On  MS-DOS,
  3223. these  are  also equivalent to read() and write(), since DOS
  3224. libraries are generally clever  enough  to  convert  newline
  3225.  
  3226.  
  3227.  
  3228.                      November 30, 1993
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234. 8-5                       INTERNAL                       8-5
  3235.  
  3236.  
  3237. characters  automatically.   For  Atari TOS, though, the MWC
  3238. library is too stupid to do  this,  so  we  had  to  do  the
  3239. conversion explicitly.
  3240.  
  3241.      Other macros may substitute index()  for  strchr(),  or
  3242. bcopy()  for memcpy(), or map the "void" data type to "int",
  3243. or whatever.
  3244.  
  3245.      The file "tinytcap.c" contains a set of functions  that
  3246. emulate  the  termcap  library  for  a small set of terminal
  3247. types.  The terminal-specific info is hard-coded  into  this
  3248. file.   It  is only used for systems that don't support real
  3249. termcap.  Another alternative for screen control can be seen
  3250. in  the  "curses.h"  and  "pc.c"  files.  Here, macros named
  3251. VOIDBIOS and CHECKBIOS are used to indirectly call functions
  3252. which perform low-level screen manipulation via BIOS calls.
  3253.  
  3254.      The stat() function must be able to come up with  UNIX-
  3255. style  major/minor/inode  numbers  that  uniquely identify a
  3256. file or directory.
  3257.  
  3258.      Please try to keep you changes localized, and wrap them
  3259. in  #if/#endif pairs, so that Elvis can still be compiled on
  3260. other systems.  And PLEASE let me know about it,  so  I  can
  3261. incorporate your changes into my latest-and-greatest version
  3262. of Elvis.
  3263.  
  3264.  
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.                      November 30, 1993
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303. 9.  MAKEFILE
  3304.  
  3305.      On most Operating Systems, and with most compilers, the
  3306. "Makefile.mix"  file  is  used  to  control  compilation and
  3307. installation of Elvis.  This section of the manual describes
  3308. the  overall  structure  of  "Makefile.mix", and the various
  3309. configuration options in it.
  3310.  
  3311. 9.1.  Configuring the Makefile
  3312.  
  3313.      Begin by copying "Makefile.mix" to  "Makefile".   Never
  3314. alter the original "Makefile.mix".
  3315.  
  3316.      Most of the configuration options are controlled via  a
  3317. group  of  macros.   Makefile.mix  begins  with several pre-
  3318. configured sets of macro definitions - one group for each of
  3319. the most common supported systems.  As shipped, all of these
  3320. macro definitions are commented out; you must either  uncom-
  3321. ment  out  one  of  the groups, or (for less common systems)
  3322. construct an entirely new group.
  3323.  
  3324. 9.2.  Using the Makefile
  3325.  
  3326.      After configuring the Makefile, you can run  "make"  to
  3327. compile  the  programs.   There  are  also some other useful
  3328. things that the Makefile can do...
  3329.  
  3330.           COMMAND     RESULT
  3331.           make        compile all programs
  3332.           make installcopy the programs to the BIN directory
  3333.           make clean  remove all object files
  3334.           make clobberremove everything except source & documentation
  3335.           make uue    produce uuencoded compressed tar archives of the source
  3336.           make sh     produce shar archives of the source
  3337.  
  3338.  
  3339.      Note that the last two will probably  work  only  under
  3340. UNIX.
  3341.  
  3342. 9.3.  What "make install" does
  3343.  
  3344.      To install elvis, we should copy all of the executables
  3345. into  a  directory where users can find them; copy the docu-
  3346. mentation into a directory where the on-line manual  program
  3347. can  find them; and arrange for edit buffers to be preserved
  3348. after a system crash.  The "make install" command  tries  to
  3349. do this automatically, but there are problems.
  3350.  
  3351.      Practically all operating systems allow programs to  be
  3352. installed  different  directories.  As shipped, Makefile.mix
  3353. contains somebody's best guess as to where you'd  like  them
  3354. to  go.   You should double check it, though.  The BIN macro
  3355. controls where the programs will be installed.
  3356.  
  3357.  
  3358.  
  3359.  
  3360.                      November 30, 1993
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366. 9-2                       MAKEFILE                       9-2
  3367.  
  3368.  
  3369.      On UNIX systems the  "elvprsv"  and  "elvrec"  programs
  3370. need  to  be installed as SUID-root programs.  Consequently,
  3371. you must run "make install" as root; then they will automat-
  3372. ically be installed as SUID-root.
  3373.  
  3374.      For text to be recovered after a  crash,  you  need  to
  3375. arrange  for the "elvprsv" program to be run before the /tmp
  3376. file is cleaned.  This means that the /etc/rc file (or what-
  3377. ever)  needs  to  be edited.  If you have a SysV UNIX system
  3378. which uses a /etc/rc2.d directory for storing start-up  com-
  3379. mands,  then  you're lucky.  "make install" will detect that
  3380. /etc/rc2.d exists and attempt to automatically create a file
  3381. called  "/etc/rc2.d/S03elvis"  which runs elvprsv.  However,
  3382. for non-UNIX systems, or UNIX systems  which  don't  have  a
  3383. /etc/rc2.d  directory,  you'll need to do this by hand.  See
  3384. the "Versions" section of the manual for hints  about  doing
  3385. this on your particular system.
  3386.  
  3387.      Non-UNIX systems don't  have  a  standard  place  where
  3388. UNIX-style  man-pages  go, so "make install" doesn't attempt
  3389. to install documentation on those systems.
  3390.  
  3391.      On UNIX systems, there is no standard place either, but
  3392. you  can  be pretty sure that your system has a non-standard
  3393. one.  There is a  shell  script  called  "instman.sh"  which
  3394. attempts  to  figure  out where the man-pages belong on your
  3395. system, and then copies them there.  You might need to  edit
  3396. "instman.sh"  to  make  it  work,  but  try  it as-is first.
  3397. "instman.sh" is automatically run by "make install".
  3398.  
  3399.      Note: It is safe to run "make install" more than once.
  3400.  
  3401. 9.4.  Summary of Macros
  3402.  
  3403.      The following describes the configuration macros.  With
  3404. most  versions  of  make,  a  blank macro can simply be left
  3405. undefined.
  3406.  
  3407. OBJ  This is the  filename  extension  for  unlinked  object
  3408.      files - usually .o, but MS-DOS uses .obj.
  3409.  
  3410. EXE  This is the filename  extension  for  elvis  executable
  3411.      file - usually nothing, but MS-DOS uses .exe, and other
  3412.      operating systems may use something else.
  3413.  
  3414. COM  This is the filename extension for the  executables  of
  3415.      elvis'  support  programs - usually the same as the EXE
  3416.      macro, but since the  support  programs  are  all  much
  3417.      smaller that elvis, MS-DOS can use the .com format.
  3418.  
  3419. EXTRAThis is  a  space-delimited  list  of  version-specific
  3420.      object  files to be linked into elvis.  Typically, this
  3421.      list will contain at least one object  file  which  was
  3422.      written  specifically for a given operating system.  It
  3423.  
  3424.  
  3425.  
  3426.                      November 30, 1993
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432. 9-3                       MAKEFILE                       9-3
  3433.  
  3434.  
  3435.      may also contain "tinytcap$(OBJ)" or "tinyprnt$(OBJ)".
  3436.  
  3437. EXTRA2This is a  space-delimited  list  of  version-specific
  3438.      object  files  used  in  elvis and a few of the support
  3439.      programs.  For UNIX-like systems, this is typically  an
  3440.      empty  list.   For  non-UNIX  systems,  it will usually
  3441.      either be empty, or it will  contain  the  name  of  an
  3442.      object file which contains functions which emulate cer-
  3443.      tain UNIX system calls.  (Not all non-UNIX systems need
  3444.      any   special   emulation   functions,  because  all  C
  3445.      libraries try to emulate UNIX.  You only need an EXTRA2
  3446.      list if the library doesn't emulate UNIX well enough.)
  3447.  
  3448. LIBS This is a list of  library  flags  used  while  linking
  3449.      elvis.   UNIX  systems  need  "-ltermcap"  or something
  3450.      similar,    unless    the    EXTRA    macro    includes
  3451.      "tinytcap$(OBJ)".   Most  other  operating  systems use
  3452.      "tinytcap$(OBJ)" and don't need anything else, so  they
  3453.      leave the LIBS list empty.
  3454.  
  3455. BIN  This is  the  directory  where  executables  should  be
  3456.      installed by "make install".
  3457.  
  3458. CC   This is the C compiler command, possibly  with  "memory
  3459.      model" flags.
  3460.  
  3461. CFLAGSThis lists the compiler flags used to select  compile-
  3462.      time  options.   The  "CFLAGS"  section  of this manual
  3463.      describes this in detail.
  3464.  
  3465. LNK  This is the name of the linker.  If  you  want  to  use
  3466.      $(CC) as your linker, then you can leave LNK undefined.
  3467.  
  3468. LFLAGSThis is a list of linker flags used  to  select  link-
  3469.      time options.  It is almost always blank.
  3470.  
  3471. SMALLThe flag for special small memory model  compilation  -
  3472.      usually blank.
  3473.  
  3474. OF   The link flag to control the output file's name -  usu-
  3475.      ally  -o<space>.   The Sun version of "make" strips off
  3476.      trailing whitespace, so a pair of empty quotes has been
  3477.      added  after  the  space,  to protect it.  On non-Suns,
  3478.      this isn't necessary.
  3479.  
  3480. RF   The flag used to denote "compile but don't link" - usu-
  3481.      ally -c
  3482.  
  3483. PROGSThis is a space-delimited list of all  programs.   This
  3484.      list  always  includes  elvis,  ctags, ref, elvrec, and
  3485.      elvprsv.  Also, everybody gets fmt except for BSD UNIX;
  3486.      it  already  has  its  own  version  of fmt as standard
  3487.      equipment.
  3488.  
  3489.  
  3490.  
  3491.  
  3492.                      November 30, 1993
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498. 9-4                       MAKEFILE                       9-4
  3499.  
  3500.  
  3501.      Most non-UNIX systems also include the vi, ex, and view
  3502.      aliases.  (UNIX doesn't need those aliases in the PROGS
  3503.      list because it creates  them  via  file  links  during
  3504.      installation.)  OS-9  doesn't  include  the  ex  alias,
  3505.      because there is already a command by that  name  built
  3506.      into its standard shell.
  3507.  
  3508.      Note: some MS-DOS configurations break this  list  into
  3509.      two  smaller  lists, to compensate for MS-DOS's limita-
  3510.      tions on command line length.
  3511.  
  3512. CHMEMThis is either blank, or a command to  be  run  immedi-
  3513.      ately  after  linking elvis.  Under Minix and Coherent,
  3514.      elvis needs to have extra space assigned for the  stack
  3515.      &  heap  after it has been linked, so their commands to
  3516.      do that are placed here.  Most other operating  systems
  3517.      generally  either  don't  need  to  have  their  stacks
  3518.      enlarged, or they enlarge it during linking.
  3519.  
  3520. SORT This should be defined to be -DSORT if  you  want  your
  3521.      tags  list  to  be  sorted,  or  blank  if  you want it
  3522.      unsorted.  The real vi requires a sorted tags file,  so
  3523.      for  the  sake  of compatibility all of the UNIX confi-
  3524.      gurations use -DSORT.  Elvis doesn't need a sorted tags
  3525.      file, though, so on non-UNIX systems you can leave this
  3526.      macro blank.
  3527.  
  3528. RM   This is the name of a program that deletes files uncon-
  3529.      ditionally.   It  is  used  during "make clean".  RM is
  3530.      defined as "rm -f" for UNIX systems, or "del" for  most
  3531.      others.
  3532.  
  3533. CP   This is the name of a program  that  copies  files.   -
  3534.      usually  "cp"  or  "copy".   It  is  used  during "make
  3535.      install".
  3536.  
  3537. SYS  This is the type of system.  It is used  to  select  an
  3538.      appropriate  style of linking and installation that are
  3539.      used by "make" and "make install",  respectively.   The
  3540.      available types are:
  3541.  
  3542.                          unx       UNIX and UNIX-like systems
  3543.                          dos       MS-DOS
  3544.                          ami       AmigaDos
  3545.                          tos       Atari TOS
  3546.                          os9       OS-9/68k
  3547.                          vms       VAX/VMS
  3548.                          xdos      cross-compiled on SCO for MS-DOS
  3549.  
  3550.  
  3551. DUMMYThis is used as the "source" filename in the dependency
  3552.      list  of  targets which are supposed to be uncondition-
  3553.      ally compiled.  It is usually nothing since  most  ver-
  3554.      sions  of  "make"  treat an empty source file list as a
  3555.  
  3556.  
  3557.  
  3558.                      November 30, 1993
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564. 9-5                       MAKEFILE                       9-5
  3565.  
  3566.  
  3567.      special case, but OS-9 needs it defined as "dummy"  and
  3568.      further  requires  that  there  be no actual file named
  3569.      dummy.
  3570.  
  3571. CFG  The is the name of the compiler  configuration  file  -
  3572.      usually blank, since most compilers don't need a confi-
  3573.      guration file.  Some MS-DOS compilers need it, though.
  3574.  
  3575. 9.5.  Structure of Makefile.mix
  3576.  
  3577.      Makefile.mix begins with several sets of commented  out
  3578. configuration macro definitions, as described above.  A com-
  3579. ment saying "The rest of this  Makefile  contains  no  user-
  3580. serviceable parts" marks the end of this section.  Most peo-
  3581. ple won't need to edit anything after that.
  3582.  
  3583.      This is followed by macro definitions which are identi-
  3584. cal,  regardless  of your operating system.  The OBJS macros
  3585. list the object files that form the portable parts of elvis,
  3586. and  are  used together with the EXTRA and EXTRA2 configura-
  3587. tion macros during linking.
  3588.  
  3589.      The SRC macros list all of the files mentioned  in  the
  3590. "MANIFEST"  file.   These are used to bundle the source code
  3591. via "make uue" or "make sh".
  3592.  
  3593.      This is followed by a target named "all" which  depends
  3594. on  all  of  the  programs listed in the PROGS configuration
  3595. macro.  This is followed by detailed instructions describing
  3596. how  each  file is compiled and linked.  The only exceptions
  3597. are the "elvis"  program,  and  the  various  forms  of  the
  3598. "alias" program.
  3599.  
  3600.      Linking a big program like  elvis  is  non-standard  on
  3601. some  systems.   To  support  this,  we  just say that elvis
  3602. depends on "linkelv.$(SYS)", where "$(SYS)" is  replaced  by
  3603. whatever you defined the SYS configuration macro to be.  The
  3604. various link styles are listed after that.  The only  really
  3605. tricky one is for DOS.  Since the list of files to be linked
  3606. is too long to fit on  a  DOS  command  line,  a  customized
  3607. response  file is created, and the name of the response file
  3608. is passed instead.  The exact format of  the  response  file
  3609. depends on the compiler you're using.
  3610.  
  3611.      This is followed by system-dependent  ways  of  linking
  3612. the "alias" object file to create multiple executables.  For
  3613. most systems, we only really link it once to form  the  "ex"
  3614. executable,  and then copy that executable to form the "vi",
  3615. "view", and "input" executables.  OS-9, though, doesn't need
  3616. an  "ex"  executable and it requires actual linking for each
  3617. alias.
  3618.  
  3619.      Next comes installation, in all  its  system  dependent
  3620. forms.   This uses the now-familiar trick of saying that the
  3621.  
  3622.  
  3623.  
  3624.                      November 30, 1993
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630. 9-6                       MAKEFILE                       9-6
  3631.  
  3632.  
  3633. "install" target depends on a bogus file named "inst.$(SYS)"
  3634. and  then  listing  each  installation technique after that.
  3635. There should be no surprises here.
  3636.  
  3637.      The rest of Makefile.mix contains a few  handy  pseudo-
  3638. targets, such as "make clean".
  3639.  
  3640.  
  3641.  
  3642.  
  3643.  
  3644.  
  3645.  
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.  
  3656.  
  3657.  
  3658.  
  3659.  
  3660.  
  3661.  
  3662.  
  3663.  
  3664.  
  3665.  
  3666.  
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.  
  3688.  
  3689.  
  3690.                      November 30, 1993
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699. 10.  CFLAGS
  3700.  
  3701.      Elvis uses many preprocessor symbols to control  compi-
  3702. lation.   Some  of  these  control  the sizes of buffers and
  3703. such.  The "-DNO_XXXX" options remove small sets of  related
  3704. features.
  3705.  
  3706.      Most  Elvis  users  will  probably  want  to  keep  all
  3707. features  available.   Minix-PC  users, though, will have to
  3708. sacrifice some sets because otherwise  Elvis  would  be  too
  3709. bulky  to  compile.   The "asld" phase of the compiler craps
  3710. out.
  3711.  
  3712. -DM_SYSV, -Dbsd, -DTOS, -DCOHERENT, -Damiga
  3713.      These flags tell the compiler that Elvis is being  com-
  3714.      piled for System-V UNIX, BSD UNIX, Atari TOS, Coherent,
  3715.      or AmigaDos,  respectively.   For  other  systems,  the
  3716.      config.h  file  can  generally  figure it out automati-
  3717.      cally.
  3718.  
  3719. -DRAINBOW
  3720.      For MS-DOS systems, this causes  support  for  the  DEC
  3721.      Rainbow to be compiled into Elvis.
  3722.  
  3723. -DNO_S5WINSIZE
  3724.      Some versions of SysV UNIX don't  support  support  the
  3725.      "winsize"  style of screen-size testing.  If you have a
  3726.      SysV system and  can't  compile  "curses.c",  then  try
  3727.      adding -DNO_S5WINSIZE to the CFLAGS.
  3728.  
  3729. -DTERMIOS
  3730.      POSIX is a SysV-derived specification which uses a ter-
  3731.      minal  control  package  called  "termios",  instead of
  3732.      "termio".  Some other SysV systems may  also  use  ter-
  3733.      mios.   You  can make elvis uses termios instead of the
  3734.      more common  termio  by  adding  -DTERMIOS  to  CFLAGS.
  3735.      (Note: This hasn't been tested very well.)
  3736.  
  3737. -DNBUFS=number
  3738.      Elvis keeps most of your text in a temporary file; only
  3739.      a  small  amount  is actually stored in RAM.  This flag
  3740.      allows you to control how much of the file  can  be  in
  3741.      RAM  at  any  time.   The  default is 5 blocks, and the
  3742.      minimum is 3 blocks.  (See the -DBLKSIZE flag, below.)
  3743.  
  3744.      More RAM allows global changes to happen a little  fas-
  3745.      ter.   If  you're just making many small changes in one
  3746.      section of a file, though, extra RAM won't help much.
  3747.  
  3748. -DBLKSIZE=number
  3749.      This controls the size of blocks that Elvis uses inter-
  3750.      nally.   The  value  of BLKSIZE must be a power of two.
  3751.      Every time you double BLKSIZE, you quadruple  the  size
  3752.      of  a  text  file  that  Elvis can handle, but you also
  3753.  
  3754.  
  3755.  
  3756.                      November 30, 1993
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762. 10-2                       CFLAGS                       10-2
  3763.  
  3764.  
  3765.      cause the temporary file to grow faster.   For  MS-DOS,
  3766.      Coherent,  and  Minix-PC,  the  default  value is 1024,
  3767.      which allows you to edit files up to almost 512K  bytes
  3768.      long.   For  all  other  systems,  the default value is
  3769.      2048, which allows you to edit files that are nearly  2
  3770.      megabytes long.
  3771.  
  3772.      The BLKSIZE also determines the  maximum  line  length,
  3773.      and  a few other limits.  BLKSIZE should be either 256,
  3774.      512, 1024, or 2048.  Values other than these  can  lead
  3775.      to strange behavior.
  3776.  
  3777. -DTMPDIR=string
  3778.      This sets the default value of the "directory"  option,
  3779.      which   specifies  where  the  temporary  files  should
  3780.      reside.  The value of TMPDIR must be a  string,  so  be
  3781.      sure  your  value includes the quote characters on each
  3782.      end.
  3783.  
  3784. -DEXRC=str, -DHMEXRC=str, -DSYSEXRC=str, -DEXINIT=str
  3785.      This lets you control the names of  the  initialization
  3786.      files.   Their  values  must  be strings, so be careful
  3787.      about quoting.
  3788.  
  3789.      EXRC is the name of  the  initialization  file  in  the
  3790.      current  directory.   Its  default  value is ".exrc" on
  3791.      UNIX systems -- the same as the real  vi.   Since  that
  3792.      isn't  a  legal  DOS filename, under DOS the default is
  3793.      "elvis.rc".  For  other  systems,  check  the  config.h
  3794.      file.
  3795.  
  3796.      HMEXRC is the name of the initialization file  in  your
  3797.      home  directory.   By  default, it is the same as EXRC.
  3798.      Elvis will automatically prepend the name of your  home
  3799.      directory  to  HMEXRC at run time, so don't give a full
  3800.      path name.
  3801.  
  3802.      SYSEXRC is the name  of  a  system-wide  initialization
  3803.      file.   It  has no default value; if you don't define a
  3804.      value for it, then the code that supports SYSEXRC  just
  3805.      isn't  compiled.  The value of SYSEXRC should be a full
  3806.      pathname, in quotes.
  3807.  
  3808.      EXINIT is the name of an environment variable that  can
  3809.      contain  initialization  commands.  Normally, its value
  3810.      is "EXINIT".
  3811.  
  3812. -DKEYWORDPRG=string
  3813.      This  flag  determines  the  default   value   of   the
  3814.      "keywordprg" option.  Its value must be a string, so be
  3815.      careful about quoting.  The default value of this  flag
  3816.      is "ref", which is a C reference program.
  3817.  
  3818. -DCC_COMMAND=string -DMAKE_COMMAND=string -DERRLIST=string
  3819.  
  3820.  
  3821.  
  3822.                      November 30, 1993
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828. 10-3                       CFLAGS                       10-3
  3829.  
  3830.  
  3831.      These control the names of the C compiler,  the  "make"
  3832.      utility, and the error output file, respectively.  They
  3833.      are only used if -DNO_ERRLIST is not given.
  3834.  
  3835.      The default value of CC_COMMAND depends on the  Operat-
  3836.      ing  System and compiler that you use to compile elvis;
  3837.      for UNIX, the default is "cc".  The default  values  of
  3838.      MAKE_COMMAND  and  ERRLIST  are  "make"  and "errlist",
  3839.      respectively.
  3840.  
  3841. -DMAXRCLEN=number
  3842.      This determines how large a :@  macro  command  can  be
  3843.      (measured  in  bytes).   The default is 1000 bytes.  If
  3844.      you increase this value  significantly,  then  you  may
  3845.      need  to  allocate extra memory for the stack.  See the
  3846.      "CHMEM" setting in the Makefile.
  3847.  
  3848. -DSHELL=string
  3849.      This is the default value of the  "shell"  option,  and
  3850.      hence  the  default shell used from within Elvis.  This
  3851.      only controls the default; the value you give here  may
  3852.      be  overridden  at  run-time  by setting an environment
  3853.      variable named SHELL  (or  COMSPEC  for  MS-DOS).   Its
  3854.      value  must  be  a string constant, so be careful about
  3855.      quoting.
  3856.  
  3857. -DMAILER=string
  3858.      This is the name of the program that Elvis uses to send
  3859.      mail  to  a  user  whose  text has just been preserved.
  3860.      (See the manual page for the elvprsv program.) If  your
  3861.      system doesn't use electronic mail, then this option is
  3862.      irrelevant.  For UNIX and  OS-9  systems,  though,  the
  3863.      value  should be a quoted string.  The default value is
  3864.      "mail", but SysV users may prefer to use  "mailx",  and
  3865.      BSD users may prefer "Mail".
  3866.  
  3867. -DTAGS=string
  3868.      This sets the name of the "tags" file, which is used by
  3869.      the :tag command.  Its value must be a string constant,
  3870.      so be careful about quoting.
  3871.  
  3872. -DCS_IBMPC -DCS_LATIN1 -DCS_SPECIAL
  3873.      The digraph table and  flipcase  option  will  normally
  3874.      start  out  empty.   However,  if you add -DCS_IBMPC or
  3875.      -DCS_LATIN1 to your CFLAGS, then they  will  start  out
  3876.      filled  with values that are appropriate for the IBM PC
  3877.      character set or the ISO Latin-1 character set, respec-
  3878.      tively.
  3879.  
  3880.      You can also use -DCS_IBMPC and  -DCS_SPECIAL  together
  3881.      to  get  digraphs that produce the PC's graphic charac-
  3882.      ters.
  3883.  
  3884. -DDEBUG -DEBUG2
  3885.  
  3886.  
  3887.  
  3888.                      November 30, 1993
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894. 10-4                       CFLAGS                       10-4
  3895.  
  3896.  
  3897.      -DDEBUG adds the ":debug" and ":validate" commands, and
  3898.      also   adds   many  internal  consistency  checks.   It
  3899.      increases the size of the ".text" segment by about 6K.
  3900.  
  3901.      -DDEBUG2 causes a line to be appended to a file  called
  3902.      "debug.out"  everytime  any  change is made to the edit
  3903.      buffer.
  3904.  
  3905. -DCRUNCH
  3906.      This flag removes some non-critical code, so that Elvis
  3907.      is  smaller.   For example, it removes a short-cut from
  3908.      the regexp package, so that text searches  are  slower.
  3909.      Also, screen updates are not as efficient.  A couple of
  3910.      obscure features are disabled by this, too.
  3911.  
  3912. -DNO_MKEXRC
  3913.      This removes the ":mkexrc"  command,  so  you  have  to
  3914.      create any .exrc files manually.  The size of the .text
  3915.      segment will be reduced by about 1500 bytes.
  3916.  
  3917. -DNO_CHARATTR
  3918.      Permanently disables the charattr option.  This reduces
  3919.      the size of your ".text" segment by about 850 bytes.
  3920.  
  3921. -DNO_RECYCLE
  3922.      Normally, Elvis will recycle space (from the  temporary
  3923.      file)  which contains totally obsolete text.  This flag
  3924.      disables  this  recycling.   Without   recycling,   the
  3925.      ".text"  segment is about 1K smaller than it would oth-
  3926.      erwise be, but the tmp file grows much faster.  If  you
  3927.      have  a  lot of free space on your hard disk, but Elvis
  3928.      is too bulky to run with recycling, then try it without
  3929.      recycling.
  3930.  
  3931.      When using a version of Elvis that  has  been  compiled
  3932.      with  -DNO_RECYCLE, you should be careful to avoid mak-
  3933.      ing many small changes to a file because  each  indivi-
  3934.      dual change will cause the tmp file to grow by at least
  3935.      1k.  Hitting "x" thirty times counts as thirty changes,
  3936.      but  typing  "30x"  counts  as  one  change.  Also, you
  3937.      should occasionally do a ":w" followed  by  a  ":e"  to
  3938.      start with a fresh tmp file.
  3939.  
  3940.      Interestingly, the real vi never  recycles  space  from
  3941.      its temporary file.
  3942.  
  3943. -DNO_SENTENCE
  3944.      Leaves out the "(" and ")" visual mode commands.  Also,
  3945.      the  "[[",  "]]", "{", and "}" commands will not recog-
  3946.      nize *roff macros.  The sections and paragraphs options
  3947.      go  away.   This  saves  about 650 bytes in the ".text"
  3948.      segment.
  3949.  
  3950. -DNO_CHARSEARCH
  3951.  
  3952.  
  3953.  
  3954.                      November 30, 1993
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960. 10-5                       CFLAGS                       10-5
  3961.  
  3962.  
  3963.      Leaves out the visual commands  which  locate  a  given
  3964.      character  in the current line: "f", "t", "F", "T", ","
  3965.      and ";".  This saves about 900 bytes.
  3966.  
  3967. -DNO_EXTENSIONS
  3968.      Leaves out the "K" and "#" visual commands.  Also,  the
  3969.      arrow  keys will no longer work in input mode.  Regular
  3970.      expressions will no longer recognize the \{\} operator.
  3971.      (Other  extensions are either inherent in the design of
  3972.      Elvis, or are controlled by more specific flags, or are
  3973.      too  tiny  to  be worth removing.) This saves about 250
  3974.      bytes.
  3975.  
  3976. -DNO_MAGIC
  3977.      Permanently disables the "magic" option, so  that  most
  3978.      meta-characters  in  a  regular  expression  are  *NOT*
  3979.      recognized.  This  saves  about  3k  of  space  in  the
  3980.      ".text" segment, because the complex regular expression
  3981.      code can be replaced by much simpler code.
  3982.  
  3983. -DNO_SHOWMODE
  3984.      Permanently  disables  the  "showmode"  option,  saving
  3985.      about 250 bytes.
  3986.  
  3987. -DNO_CURSORSHAPE
  3988.      Normally, Elvis tries to adjust the shape of the cursor
  3989.      as   a   reminder   of   which  mode  you're  in.   The
  3990.      -DNO_CURSORSHAPE flag disables this, saving  about  150
  3991.      bytes.
  3992.  
  3993. -DNO_DIGRAPH
  3994.      To allow entry of non-ASCII characters, Elvis  supports
  3995.      digraphs.   A digraph is a single (non-ASCII) character
  3996.      which is entered as a combination of two other  (ASCII)
  3997.      characters.  If you don't need to input non-ASCII char-
  3998.      acters, or if your keyboard supports a  better  way  of
  3999.      entering non-ASCII characters, then you can disable the
  4000.      digraph code and save about 450 bytes.
  4001.  
  4002. -DNO_ERRLIST
  4003.      Elvis adds a ":errlist" command,  which  is  useful  to
  4004.      programmers.   If  you don't need this feature, you can
  4005.      disable it via the -DNO_ERRLIST flag.  This will reduce
  4006.      the .text segment by about 900 bytes, and the .bss seg-
  4007.      ment by about 300 bytes.
  4008.  
  4009. -DNO_ABBR
  4010.      The -DNO_ABBR flag disables the  ":abbr"  command,  and
  4011.      reduces the size of Elvis by about 250 bytes.
  4012.  
  4013. -DNO_OPTCOLS
  4014.      When Elvis displays the current  options  settings  via
  4015.      the  ":set"  command,  the  options are normally sorted
  4016.      into columns.  The -DNO_OPTCOLS flag causes the options
  4017.  
  4018.  
  4019.  
  4020.                      November 30, 1993
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026. 10-6                       CFLAGS                       10-6
  4027.  
  4028.  
  4029.      to be sorted across the rows, which is much simpler for
  4030.      the computer.  The -DNO_OPTCOLS flag  will  reduce  the
  4031.      size of your .text segment by about 500 bytes.
  4032.  
  4033. -DNO_MODELINES
  4034.      This removes all support for modelines.
  4035.  
  4036. -DNO_TAG
  4037.      This disables tag lookup.  It reduces the size  of  the
  4038.      .text segment by about 750 bytes.
  4039.  
  4040. -DNO_TAGSTACK
  4041.      This disables the tagstack.  The ^T and  :pop  commands
  4042.      will no longer be available.
  4043.  
  4044. -DNO_ALT_FKEY, -DNO_CTRL_FKEY, -DNO_SHIFT_FKEY, -DNO_FKEY
  4045.      These remove explicit  support  of  function  keys.   -
  4046.      DNO_ALT_FKEY  removes  support for the <alternate> ver-
  4047.      sions function keys.   -DNO_CTRL_FKEY  removes  support
  4048.      for  the  <control>  and  <alternate> versions function
  4049.      keys.  -DNO_SHIFT_FKEY removes support for the <shift>,
  4050.      <control>,  and  <alternate> versions function keys.  -
  4051.      DNO_FKEY removes all support of function keys.
  4052.  
  4053.      Elvis's ":map" command normally allows you to  use  the
  4054.      special  sequence  "#<n>" to map function key <n>.  For
  4055.      example, ":map #1 {!}fmt^M" will cause the <F1> key  to
  4056.      reformat  a paragraph.  Elvis checks the :k1=: field in
  4057.      the termcap description of your terminal to figure  out
  4058.      what  code  is  sent  by  the  <F1> key.  This is handy
  4059.      because it allows you to create a .exrc file which maps
  4060.      function  keys  the same way regardless of what type of
  4061.      terminal you use.
  4062.  
  4063.      That behavior is standard; most implementations of  the
  4064.      real  vi  supports it too.  Elvis extends this to allow
  4065.      you to use "#1s" to refer  to  <shift>+<F1>,  "#1c"  to
  4066.      refer   to   <control>+<F1>,  and  "#1a"  to  refer  to
  4067.      <alt>+<F1>.  The termcap description for  the  terminal
  4068.      should have fields named :s1=:c1=:a1=: respectively, to
  4069.      define the code sent by these key  combinations.   (You
  4070.      should  also  have  :k2=:s2=:c2=:a2=: for the <F2> key,
  4071.      and so on.)
  4072.  
  4073.      But there  may  be  problems.   The  terminfo  database
  4074.      doesn't  support :s1=:c1=:a1=:, so no terminfo terminal
  4075.      description could ever support shift/control/alt  func-
  4076.      tion  keys; so you might as well add -DNO_SHIFT_FKEY to
  4077.      CFLAGS if you're using terminfo.
  4078.  
  4079.      Note that, even if you have -DNO_FKEYS, you  can  still
  4080.      configure  Elvis  to  use your function keys my mapping
  4081.      the literal character codes sent by the key.  You  just
  4082.      couldn't do it in a terminal-independent way.
  4083.  
  4084.  
  4085.  
  4086.                      November 30, 1993
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092. 10-7                       CFLAGS                       10-7
  4093.  
  4094.  
  4095. -DTERM_925, -DTERM_AMIGA, -DTERM_VT100, -DTERM_VT52, etc.
  4096.      The tinytcap.c file contains  descriptions  of  several
  4097.      terminal  types.  For each system that uses tinytcap, a
  4098.      reasonable subset  of  the  available  descriptions  is
  4099.      actually  compiled  into Elvis.  If you wish to enlarge
  4100.      this  subset,  then  you  can   add   the   appropriate
  4101.      -DTERM_XXX flag to your CFLAGS settings.
  4102.  
  4103.      For a list of the available terminal types,  check  the
  4104.      tinytcap.c file.
  4105.  
  4106. -DINTERNAL_TAGS
  4107.      Normally, Elvis uses the "ref" program to  perform  tag
  4108.      lookup.   This  is more powerful than the real vi's tag
  4109.      lookup, but it can be much slower.
  4110.  
  4111.      If you add -DINTERNAL_TAGS to your CFLAGS setting, then
  4112.      Elvis  will use its own internal tag lookup code, which
  4113.      is faster.
  4114.  
  4115. -DPRSVDIR=directory
  4116.      This controls where preserved files will be placed.  An
  4117.      appropriate  default has been chosen for each Operating
  4118.      System, so you probably don't need to worry about it.
  4119.  
  4120. -DFILEPERMS=number
  4121.      This affects the attributes of files that  are  created
  4122.      by  Elvis;  it  is  used  as the second argument to the
  4123.      creat() function.  The default is 0666 which  (on  UNIX
  4124.      systems  at least) means that anybody can read or write
  4125.      the new file, but nobody can execute it.  On UNIX  sys-
  4126.      tems, the creat() call modifies this via the umask set-
  4127.      ting.
  4128.  
  4129. -DKEYBUFSIZE=number
  4130.      This determines the size of the type-ahead buffer  that
  4131.      elvis uses.  It also limits the size of keymaps that it
  4132.      can handle.  The  default  is  1000  characters,  which
  4133.      should be plenty.
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.                      November 30, 1993
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161. 11.  TERMCAP
  4162.  
  4163.      Elvis uses fairly  standard  termcap  fields  for  most
  4164. things.   I  invented the cursor shape names and some of the
  4165. function key names, but other than that there should be  few
  4166. surprises.
  4167.  
  4168. Required numeric fields
  4169.  
  4170.         :co#:       number of columns on the screen (chars per line)
  4171.         :li#:       number of lines on the screen
  4172.  
  4173.  
  4174.      On many systems, Elvis has other ways to find  out  how
  4175. many  rows and columns your screen can show, so these values
  4176. might not be very relevent.  If these numbers  aren't  given
  4177. in  your termcap entry, and Elvis can't find the screen size
  4178. any other way, then it will default to 80x24.
  4179.  
  4180. Required string fields
  4181.  
  4182.         :ce=:       clear to end-of-line
  4183.         :cm=:       move the cursor to a given row/column
  4184.         :up=:       move the cursor up one line
  4185.  
  4186.  
  4187.      If these fields are missing, then Elvis will still  run
  4188. fairly well in "ex" mode, but "vi" mode requires these capa-
  4189. bilities as an absolute minimum.
  4190.  
  4191. Boolean fields
  4192.  
  4193.         :am:        auto margins - wrap when char is written in last column?
  4194.         :xn:        brain-damaged auto margins - newline ignored after wrap
  4195.         :pt:        physical tabs?
  4196.  
  4197.  
  4198. Optional string fields
  4199.  
  4200.         :al=:       insert a blank row on the screen
  4201.         :cl=:       home the cursor & clear the screen
  4202.         :dl=:       delete a row from the screen
  4203.         :cd=:       clear to end of display
  4204.         :ei=:       end insert mode
  4205.         :ic=:       insert a blank character
  4206.         :im=:       start insert mode
  4207.         :dc=:       delete a character
  4208.         :sr=:       scroll reverse (insert row at top of screen)
  4209.         :vb=:       visible bell
  4210.         :ks=:       keypad enable
  4211.         :ke=:       keypad disable
  4212.         :ti=:       terminal initialization string, to start full-screen mode
  4213.         :te=:       terminal termination, to end full-screen mode
  4214.  
  4215.  
  4216.  
  4217.  
  4218.                      November 30, 1993
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224. 11-2                      TERMCAP                       11-2
  4225.  
  4226.  
  4227. Optional strings received from the keyboard
  4228.  
  4229.         :kd=:       sequence sent by the <down arrow> key
  4230.         :kl=:       sequence sent by the <left arrow> key
  4231.         :kr=:       sequence sent by the <right arrow> key
  4232.         :ku=:       sequence sent by the <up arrow> key
  4233.         :kP=:       sequence sent by the <PgUp> key
  4234.         :kN=:       sequence sent by the <PgDn> key
  4235.         :kh=:       sequence sent by the <Home> key
  4236.         :kH=:       sequence sent by the <End> key
  4237.         :kI=:       sequence sent by the <Insert> key
  4238.  
  4239.  
  4240.      Originally, termcap  didn't  have  any  names  for  the
  4241. <PgUp>,  <PgDn>, <Home>, and <End> keys.  Although the capa-
  4242. bility names shown in the table above are the  most  common,
  4243. they  are  not  universal.  SCO Xenix uses :PU=:PD=:HM=:EN=:
  4244. for those keys.  Also, if the four arrow keys happen  to  be
  4245. part  of  a  3x3 keypad, then the five non-arrow keys may be
  4246. named :K1=: through :K5=:, so an  IBM  PC  keyboard  may  be
  4247. described  using those names instead.  Elvis can find any of
  4248. these names.
  4249.  
  4250. Optional strings sent by function keys
  4251.  
  4252.         :k1=:...:k9=:k0=:   codes sent by <F1> through <F10> keys
  4253.         :s1=:...:s9=:s0=:   codes sent by <Shift F1> ... <Shift F10>
  4254.         :c1=:...:c9=:c0=:   codes sent by <Ctrl F1> ... <Ctrl F10>
  4255.         :a1=:...:a9=:a0=:   codes sent by <Alt F1> ... <Alt F10>
  4256.  
  4257.  
  4258.      Note that :k0=: is used  to  describe  the  <F10>  key.
  4259. Some  termcap  documents  recommend  :ka=: or even :k;=: for
  4260. describing the <F10> key, but Elvis doesn't support that.
  4261.  
  4262.      Also, the :s1=:..., :c1=:..., and  :a1=:...  codes  are
  4263. very  non-standard.   The  terminfo  library doesn't support
  4264. them.  Consequently, if you're using  the  terminfo  library
  4265. then  you  might  as well add -DNO_SHIFT_FKEY to your CFLAGS
  4266. setting.
  4267.  
  4268. Optional fields that describe character attributes
  4269.  
  4270.         :so=:se=:   start/end standout mode (We don't care about :sg#:)
  4271.         :us=:ue=:   start/end underlined mode
  4272.         :md=:me=:   start/end boldface mode
  4273.         :as=:ae=:   start/end alternate character set (italics)
  4274.         :ug#:       visible gap left by :us=:ue=:md=:me=:as=:ae=:
  4275.  
  4276.  
  4277. Optional fields that affect the cursor's shape
  4278.  
  4279.      The :cQ=: string is used by  Elvis  immediately  before
  4280. exiting  to  undo  the  effects  of  the  other cursor shape
  4281.  
  4282.  
  4283.  
  4284.                      November 30, 1993
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290. 11-3                      TERMCAP                       11-3
  4291.  
  4292.  
  4293. strings.  If :cQ=: is not given, then all other cursor shape
  4294. strings are ignored.
  4295.  
  4296.         :cQ=:       normal cursor
  4297.         :cX=:       cursor used for reading EX command
  4298.         :cV=:       cursor used for reading VI commands
  4299.         :cI=:       cursor used during VI input mode
  4300.         :cR=:       cursor used during VI replace mode
  4301.  
  4302.  
  4303.      If the capabilities above aren't given, then Elvis will
  4304. try to use the following values instead.
  4305.  
  4306.         :ve=:       normal cursor, used as :cQ=:cX=:cI=:cR=:
  4307.         :vs=:       gaudy cursor, used as :cV=:
  4308.  
  4309.  
  4310. An example
  4311.  
  4312.      Here's the termcap entry I use on my Minix-ST system.
  4313.  
  4314.  
  4315. mx|minix|minixst|ansi:\
  4316.         :is=\E[0~:co#80:li#25:bs:pt:\
  4317.         :cm=\E[%i%d;%dH:up=\E[A:do=^J:nd=\E[C:sr=\EM:\
  4318.         :cd=\E[J:ce=\E[K:cl=\E[H\E[J:\
  4319.         :al=\E[L:dl=\E[M:ic=\E[@:dc=\E[P:im=:ei=:\
  4320.         :so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:\
  4321.         :md=\E[1m:me=\E[m:as=\E[1;3m:ae=\E[m:\
  4322.         :ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D:\
  4323.         :k1=\E[1~:k2=\E[2~:k3=\E[3~:k4=\E[4~:k5=\E[5~:\
  4324.         :k6=\E[6~:k7=\E[17~:k8=\E[18~:k9=\E[19~:k0=\E[20~:
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.  
  4338.  
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344.  
  4345.  
  4346.  
  4347.  
  4348.  
  4349.  
  4350.                      November 30, 1993
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359. 12.  ENVIRONMENT VARIABLES
  4360.  
  4361.      Elvis examines several environment  variables  when  it
  4362. starts  up.   The  values of these variables are used inter-
  4363. nally for a variety of purposes.  You don't need  to  define
  4364. all  of  these; on most systems, Elvis only requires TERM to
  4365. be defined.  On AmigaDOS, MS-DOS or TOS systems,  even  that
  4366. is optional.
  4367.  
  4368. TERM, TERMCAP
  4369.      TERM tells Elvis the name of the termcap entry to  use.
  4370.      TERMCAP may contain either the entire termcap entry, or
  4371.      the  full  pathname  of  the  termcap  file  to  search
  4372.      through.
  4373.  
  4374.      If your version of Elvis is using tinytcap  instead  of
  4375.      the  full  termcap  library,  then the value of TERMCAP
  4376.      can't be the name of a file; it can only be  undefined,
  4377.      or  contain  the  entire termcap entry.  In the termcap
  4378.      entry, tinytcap will convert \E to an <Esc>  character,
  4379.      but  other  backslash  escapes  (\b, \r, etc.) or carat
  4380.      escapes (^[, ^M, etc.) will not be converted to control
  4381.      characters.   Instead, you should embed the actual con-
  4382.      trol character into the string.
  4383.  
  4384. TMP, TEMP
  4385.      These only work for AmigaDOS,  MS-DOS  and  Atari  TOS.
  4386.      Either  of  these  variables  may  be  used  to set the
  4387.      "directory"  option,  which  controls  where  temporary
  4388.      files are stored.  If you define them both, then TMP is
  4389.      used, and TEMP is ignored.
  4390.  
  4391. LINES, COLUMNS
  4392.      The termcap entry for your terminal should specify  the
  4393.      size  of  your  screen.   If  you're  using a windowing
  4394.      interface, then there is an  ioctl()  call  which  will
  4395.      provide the size of the window; the ioctl() values will
  4396.      override the values in the termcap  entry.   The  LINES
  4397.      and  COLUMNS  environment  variables  (if defined) will
  4398.      override either of these sources.  They, in  turn,  can
  4399.      be overridden by a ":set" command.
  4400.  
  4401.      Normally, the LINES  and  COLUMNS  variables  shouldn't
  4402.      need to be defined.
  4403.  
  4404. EXINITThis variable's value may contain one or  more  colon-
  4405.      mode  commands, which will be executed after all of the
  4406.      ".exrc" files but before interactive editing begins.
  4407.  
  4408.      To put  more  than  one  command  in  EXINIT,  you  can
  4409.      separate  the  commands  with either a newline or a '|'
  4410.      character.
  4411.  
  4412. SHELL, COMSPEC
  4413.  
  4414.  
  4415.  
  4416.                      November 30, 1993
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422. 12-2               ENVIRONMENT VARIABLES                12-2
  4423.  
  4424.  
  4425.      You can use COMSPEC in MS-DOS, or SHELL  in  any  other
  4426.      system,  to specify which shell should be used for exe-
  4427.      cuting commands and expanding wildcards.
  4428.  
  4429. HOME This variable should give the  full  pathname  of  your
  4430.      home  directory.   Elvis needs to know the name of your
  4431.      home directory so it can locate the ".exrc" file there.
  4432.  
  4433. TAGPATH
  4434.      This variable is used by the "ref"  program.   It  con-
  4435.      tains  a  list  of  directories  that  might  contain a
  4436.      relevant "tags" file.  Under AmigaDOS, MS-DOS or  Atari
  4437.      TOS,  the  names of the directories should be separated
  4438.      by semicolons (";").  Under  other  operating  systems,
  4439.      the names should be separated by colons (":").
  4440.  
  4441.      If you don't define TAGPATH,  then  "ref"  will  use  a
  4442.      default list which includes the current directory and a
  4443.      few other likely places.  See the definition of DEFTAG-
  4444.      PATH at the start of ref.c for an accurate list.
  4445.  
  4446.  
  4447.  
  4448.  
  4449.  
  4450.  
  4451.  
  4452.  
  4453.  
  4454.  
  4455.  
  4456.  
  4457.  
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.                      November 30, 1993
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491. 13.  VERSIONS
  4492.  
  4493.      Elvis currently works under  BSD  UNIX,  AT&T  System-V
  4494. UNIX,   SCO  XENIX,  Minix,  Coherent,  MS-DOS,  Atari  TOS,
  4495. OS9/68k, VAX/VMS, AmigaDos, and OS/2.  This section  of  the
  4496. manual  provides  special  information  that applies to each
  4497. particular version of Elvis.
  4498.  
  4499.      For all  versions  except  MS-DOS  and  VMS,  the  file
  4500. "Makefile.mix"  should  be  copied  to  "Makefile", and then
  4501. edited to select the correct set of options for your system.
  4502. There  is  more  information about this embedded in the file
  4503. itself.
  4504.  
  4505. 13.1.  BSD UNIX
  4506.  
  4507.      Temporary files are stored in /tmp.
  4508.  
  4509.      You should modify /etc/rc so that the  temp  files  are
  4510. preserved  when  the  system  is  rebooted.   Find a line in
  4511. /etc/rc which reads
  4512.  
  4513.      ex4.3preserve /tmp
  4514.  
  4515. or something like that, and append the following line:
  4516.  
  4517.      elvprsv /tmp/elv*
  4518.  
  4519.      If you do not have permission to modify /etc/rc,  don't
  4520. fret.  The above modification is only needed to allow you to
  4521. recover your changes after a system crash.   You  can  still
  4522. run  Elvis  without  that  modification,  and  you can still
  4523. recover your changes when Elvis crashes or when your  dialup
  4524. modem  looses  the  carrier  signal, or something like that.
  4525. Only a system crash or power failure could hurt you.
  4526.  
  4527.      Both Elvis and the real Vi read initialization commands
  4528. from  a  file  called ".exrc", but the commands in that file
  4529. might work on one editor but not the  other.   For  example,
  4530. "set  keywordprg=man"  will work for Elvis, but Vi will com-
  4531. plain because it doesn't have a "keywordprg" option.  If the
  4532. warning  messages  annoy  you,  then you can edit the CFLAGS
  4533. setting in the Makefile and add -DEXRC=\".elvisrc\".
  4534.  
  4535.      If you use X windows, you may wish to add "-DCS_LATIN1"
  4536. to  CFLAGS.  This will cause the digraph table and the flip-
  4537. case option to have default values that are appropriate  for
  4538. the  LATIN-1  character  set.  That's the standard character
  4539. set for X.
  4540.  
  4541.      The default mailer  used  notify  users  when  text  is
  4542. preserver  is "mail".  You may wish to change this to "Mail"
  4543. (with an uppercase 'M').  See the description of "MAILER" in
  4544. the CFLAGS section of this manual.
  4545.  
  4546.  
  4547.  
  4548.                      November 30, 1993
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554. 13-2                      VERSIONS                      13-2
  4555.  
  4556.  
  4557.      The default keyboard macro time-out value is larger for
  4558. BSD  than  it  is  for  some other systems, because I've had
  4559. trouble running Elvis via rlogin or Xterm.  I guess it takes
  4560. a while for those keystokes to squirt through the net.
  4561.  
  4562. 13.2.  System-V UNIX
  4563.  
  4564.      Most SysV UNIX systems use terminfo instead of termcap,
  4565. but  the  terminfo  library  doesn't seem to have a standard
  4566. name.  As shipped, Elvis' Makefile.mix  is  configured  with
  4567. "LIBS=-ltermcap".   You  may  need  to  change it to "LIBS=-
  4568. lterm" or "LIBS=-lterminfo" or even "LIBS=-lcurses".
  4569.  
  4570.      The /etc/rc file (or its equivalent) should be modified
  4571. as  described for BSD systems, above.  There's a pretty good
  4572. chance that "make install" will do this for  you;  it  knows
  4573. how  to  create  an  editor  recovery file in the /etc/rc2.d
  4574. directory, which is where most  modern  SysV  systems  store
  4575. initialization  commands.   You  only need to do it manually
  4576. for older SysV systems.
  4577.  
  4578.      The potential trouble with ".exrc" described above  for
  4579. BSD UNIX applies to System-V UNIX as well.
  4580.  
  4581.      The default mailer  used  notify  users  when  text  is
  4582. preserver  is  "mail".   You  may  wish  to  change  this to
  4583. "mailx".  See the description of "MAILER" in the CFLAGS sec-
  4584. tion of this manual.
  4585.  
  4586.      Elvis uses control-C as the interrupt key, not  Delete.
  4587. This  was done so that the <Del> key could be used for char-
  4588. acter deletion.
  4589.  
  4590. 13.3.  SCO Xenix
  4591.  
  4592.      For Xenix-386, you can use the  generic  System-V  set-
  4593. tings.   You may wish to add "-DCS_IBMPC" to CFLAGS, to have
  4594. the digraph table and flipcase option start  up  in  a  mode
  4595. that  is appropriate for the console.  Also, note that there
  4596. is a separate group of settings for use with Xenix-286.   It
  4597. already has "-DCS_IBMPC" in CFLAGS.
  4598.  
  4599.      Because Xenix is so similar to System-V,  everything  I
  4600. said  earlier  about  System-V  applies to the Xenix version
  4601. too, except that editor recovery might belong in a directory
  4602. called /etc/rc.d/8 instead.
  4603.  
  4604. 13.4.  Minix
  4605.  
  4606.      There are separate settings in Makefile.mix for  Minix-
  4607. PC  and  Minix-68k.   The  differences between these two are
  4608. that the 68k version uses ".o" for the object file extension
  4609. where  the PC version uses ".s", and the PC version has some
  4610. extra flags in CFLAGS to reduce the size of Elvis.   The  PC
  4611.  
  4612.  
  4613.  
  4614.                      November 30, 1993
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620. 13-3                      VERSIONS                      13-3
  4621.  
  4622.  
  4623. version  also uses tinytcap (instead of the full termcap) to
  4624. make it smaller.
  4625.  
  4626.      Minix-PC users should read the CFLAGS section  of  this
  4627. manual very carefully.  You have some choices to make...
  4628.  
  4629.      The  temporary  files  are  stored  in  /usr/tmp.   The
  4630. /usr/tmp  directory  must exist before you run Elvis, and it
  4631. must be readable & writable by everybody.  We  use  /usr/tmp
  4632. instead  of  /tmp  because  after  a  system  crash or power
  4633. failure, you can recover the altered version of a file  from
  4634. the  temporary  file in /usr/tmp.  If it was stored in /tmp,
  4635. though, then it would  be  lost  because  /tmp  is  normally
  4636. located  on the RAM disk.  Also, you'll need a /usr/preserve
  4637. directory which is readable & writable by root; this  direc-
  4638. tory  is  used  to store text files that have been preserved
  4639. after a crash.  The "make install" script will create it  if
  4640. necessary.
  4641.  
  4642.      Elvis uses control-C as the interrupt key, not Delete.
  4643.  
  4644. 13.5.  Coherent
  4645.  
  4646.      Elvis was ported to Coherent by Esa Ahola.
  4647.  
  4648.      Elvis is too large to run  under  Coherent  unless  you
  4649. eliminate  some features via the CFLAGS setting.  The recom-
  4650. mended settings, in Makefile.mix, produce a working  version
  4651. of Elvis which emulates Vi faithfully, but lacks most of the
  4652. extensions.  You should read  the  CFLAGS  section  of  this
  4653. manual carefully.
  4654.  
  4655.      You can probably reduce the  size  of  Elvis  by  using
  4656. tinytcap.c  instead of -lterm.  This would allow you to keep
  4657. most features of Elvis, at the expense of terminal  indepen-
  4658. dence.   (Tinytcap.c  has  ANSI  escape sequences hard-coded
  4659. into it.) To use tinytcap,  just  add  "tinytcap.o"  to  the
  4660. "EXTRA="  line in the Makefile, and remove "-lterm" from the
  4661. "LIBS=" line.
  4662.  
  4663.      The temporary files  are  stored  in  /tmp.   Preserved
  4664. files  are  stored in /usr/preserve.  You should modify your
  4665. /etc/rc file to support file preservation; add the line ...
  4666.  
  4667.         /usr/bin/elvprsv /tmp/*
  4668.  
  4669.  ... just before the first "/bin/rm" line.
  4670.  
  4671. 13.6.  Linux
  4672.  
  4673.      The Makefile.mix file has a special section of  options
  4674. for  Linux.   There should be no surprises.  Linux is mostly
  4675. SysV-ish, so the SysV comments above will apply to Linux  as
  4676. well, except that most Linux systems still have an old-style
  4677.  
  4678.  
  4679.  
  4680.                      November 30, 1993
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686. 13-4                      VERSIONS                      13-4
  4687.  
  4688.  
  4689. /etc/rc file.  You should add the command ...
  4690.  
  4691.         /usr/bin/elvprsv /tmp/*
  4692.  
  4693.  ... in there somewhere.  On my SLS 1.02 system, I added  it
  4694. near  the  end,  just before the line that runs the shell on
  4695. "/etc/rc.local".
  4696.  
  4697. 13.7.  MS-DOS
  4698.  
  4699.      Elvis was ported to MS-DOS by Guntram Blohm and  Martin
  4700. Patzel.  Willett Kempton added support for the DEC Rainbow.
  4701.  
  4702.      Ideally, Elvis should be compiled with Microsoft C 5.10
  4703. and  the  standard  Microsoft  Make utility, via the command
  4704. "make elvis.mak".  This will compile Elvis and  all  related
  4705. utilities.
  4706.  
  4707.      With Microsoft C 6.00, you may have  trouble  compiling
  4708. regexp.c.  If so, try compiling it without optimization.
  4709.  
  4710.      The "Makefile.mix" file contains  a  set  of  suggested
  4711. settings for compiling Elvis with Turbo-C or Borland C.  (If
  4712. you have Turbo-C, but not the Make  utility,  then  you  can
  4713. almost  use  the  "Elvis.prj" file to compile Elvis, but you
  4714. must  explicitly  force  Turbo-C  to  compile  it  with  the
  4715. "medium" memory model.  Most of the related programs [ctags,
  4716. ref, virec, refont, and wildcard] are only one file long, so
  4717. you  should  have  no trouble compiling them.) The "alias.c"
  4718. file is meant to be compiled once into an  executable  named
  4719. "ex.exe".   You  should  then  copy "ex.exe" to "vi.exe" and
  4720. "view.exe".
  4721.  
  4722.      Elvis stores its temporary files in C:\tmp.  If this is
  4723. not  satisfactory,  then  you should edit the CFLAGS line of
  4724. your Makefile to change TMPDIR to something else before com-
  4725. piling.  You can also control the name of the temp directory
  4726. via an environment variable named TMP or TEMP.   The  direc-
  4727. tory must exist before you can run Elvis.
  4728.  
  4729.      The TERM environment variable determines how Elvis will
  4730. write  to  the screen.  It can be set to any one of the fol-
  4731. lowing values:
  4732.  
  4733.                pcbios    Use BIOS calls on an IBM-PC clone.
  4734.                rainbow   Use DEC Rainbow interface.
  4735.                ansi      Use ANSI.SYS driver.
  4736.                nansi     User faster NANSI.SYS driver.
  4737.  
  4738.  
  4739.      If  the  TERM  variable  isn't  set,  then  Elvis  will
  4740. automatically  select  either  the "rainbow" interface (when
  4741. run on a Rainbow) or "pcbios" (on an IBM clone).
  4742.  
  4743.  
  4744.  
  4745.  
  4746.                      November 30, 1993
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752. 13-5                      VERSIONS                      13-5
  4753.  
  4754.  
  4755.      You may prefer to use NANSI.SYS for speed; or  you  may
  4756. NEED to use ANSI.SYS for a non-clone, such as a lap-top.  If
  4757. so, you should  install  one  of  these  drivers  by  adding
  4758. "driver  = nansi.sys" (or whatever) to your CONFIG.SYS file,
  4759. and then you should define TERM to be "nansi" (or  whatever)
  4760. by  adding  "set TERM=nansi" to your AUTOEXEC.BAT file.  You
  4761. must then reboot for these changes to  take  effect.   After
  4762. that,  Elvis  will  notice  the  "TERM"  setting and use the
  4763. driver.
  4764.  
  4765.      Since ".exrc" is not a valid DOS filename, the name  of
  4766. the  initialization  file  has  been  changed to "elvis.rc".
  4767. Elvis will look for an "elvis.rc" file first  in  your  home
  4768. directory.   If  it  exists,  and contains ":set exrc", then
  4769. Elvis will check  for  another  "elvis.rc"  in  the  current
  4770. directory.    By  default,  the  directory  where  ELVIS.EXE
  4771. resides is taken to be your home directory.  You  can  over-
  4772. ride  this  default by setting an environment variable named
  4773. "HOME" to the full pathname of your home directory.  To  set
  4774. "HOME",  you  would typically add the following line to your
  4775. AUTOEXEC.BAT file:
  4776.      set HOME c:\
  4777.  
  4778.      An extra program, called "wildcard", is needed for  MS-
  4779. DOS.   It  expands  wildcard  characters  in file names.  If
  4780. Elvis flashes a "Bad command or filename"  message  when  it
  4781. starts,  then  you've probably lost the WILDCARD.EXE program
  4782. somehow.
  4783.  
  4784.      Elvis can run under Windows, but you may  have  trouble
  4785. with TEMP.  Windows uses an environment variable called TEMP
  4786. which interferes with Elvis' usage of TEMP; to  work  around
  4787. this,  you  can simply set an environment variable named TMP
  4788. (with no 'E') to the name  of  Elvis'  temporary  directory.
  4789. When  TEMP  and TMP are both set, Elvis uses TMP and ignored
  4790. TEMP.
  4791.  
  4792. 13.8.  Atari TOS
  4793.  
  4794.      Elvis was ported to Atari TOS by Guntram Blohm and Mar-
  4795. tin  Patzel.   It is very similar to the MS-DOS version.  It
  4796. has been tested with the Mark Williams C compiler  and  also
  4797. GNU-C.
  4798.  
  4799.      The TERM environment variable is ignored; the  ST  port
  4800. always  assumes  that  TERM=vt52.   The SHELL (not COMSPEC!)
  4801. variable should be set to the name of a line-oriented shell.
  4802.  
  4803.      A simple shell in included with Elvis.  Its  source  is
  4804. in "shell.c", and the name of the executable is "shell.ttp".
  4805. The file "profile.sh" should contain a set  of  instructions
  4806. to  be  executed when the shell first starts up.  An example
  4807. of this file is included, but you will almost certainly want
  4808. to  edit it right away to match your configuration.  (If you
  4809.  
  4810.  
  4811.  
  4812.                      November 30, 1993
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818. 13-6                      VERSIONS                      13-6
  4819.  
  4820.  
  4821. already have a command-line shell, then you'll probably want
  4822. to  continue  using  it.  The shell that comes with Elvis is
  4823. very limited.)
  4824.  
  4825.      Currently, character attributes cannot be displayed  on
  4826. the screen.
  4827.  
  4828.      Elvis runs under MiNT (a free  multi-tasking  extension
  4829. to  TOS)  but  it  can  be a CPU hog because of the way that
  4830. Elvis reads from the keyboard  with  timeout.   Also,  Elvis
  4831. doesn't  use  any  of  the special features of MiNT.  I have
  4832. received a set of patches that optimize Elvis for MiNT,  but
  4833. they arrived too late to integrate into this release.
  4834.  
  4835. 13.9.  OS9/68k
  4836.  
  4837.      Elvis was ported to OS9/68k by Peter Reinig.
  4838.  
  4839.      The Makefile is currently configured to  install  Elvis
  4840. and  the  related  programs  in /dd/usr/cmds If this this is
  4841. unacceptable, then you should change the BIN setting to some
  4842. other  directory.   Similarly, it expects the source code to
  4843. reside in /dd/usr/src/elvis; the ODIR  setting  is  used  to
  4844. control this.
  4845.  
  4846.      Temporary files are stored in  the  /dd/tmp  directory.
  4847. Your  /dd/startup file may need to be modified to prevent it
  4848. from deleting Elvis' temporary files; make  /dd/startup  run
  4849. the elvprsv program before it wipes out /dd/tmp.
  4850.  
  4851.      The program in alias.c is linked repeatedly to  produce
  4852. the "vi", "view", and "input" aliases for Elvis.  Sadly, the
  4853. "ex" alias is impossible to implement under OS9 because  the
  4854. shell has a built-in command by that name.
  4855.  
  4856.      For some  purposes,  you  must  give  `make'  the  "-b"
  4857. option.  Specifically, you need this for "make -b clean" and
  4858. "make -b install".
  4859.  
  4860. 13.10.  VAX/VMS
  4861.  
  4862.      John Campbell ported Elvis to VAX/VMS.
  4863.  
  4864.      A heavily laden VAX can take half an  hour  to  compile
  4865. Elvis.  This is normal.  Don't panic.
  4866.  
  4867.      While running, Elvis will  create  temporary  files  in
  4868. SYS$SCRATCH.   Enter  SHOW  LOGICAL  SYS$SCRATCH to see what
  4869. actual directory you are using.  Many sites have SYS$SCRATCH
  4870. equivalenced  to  SYS$LOGIN.  The Elvis temporary files look
  4871. like the following on VMS while Elvis is running:
  4872.        ELV_1123A.1;1       ELV_1123A.2;1       SO070202.;1
  4873.  
  4874.      Also, filtering commands (like !!dir and !}fmt)  should
  4875.  
  4876.  
  4877.  
  4878.                      November 30, 1993
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884. 13-7                      VERSIONS                      13-7
  4885.  
  4886.  
  4887. work  on  VMS.   This  assumes, however, that you can create
  4888. temporary mailboxes and that your mailbox  quota  (a  sysgen
  4889. parameter)  is  at least 256 bytes for a single write to the
  4890. mailbox.  This is the default  sysgen  parameter,  so  there
  4891. should be few people who experience filter problems.
  4892.  
  4893.      Additionally, an attempt was made to support the  stan-
  4894. dard  terminals  on  VMS: "vt52", "vt100", "vt200", "vt300",
  4895. "vt101", "vt102".  Non-standard terminals could be supported
  4896. by  setting  your  terminal type to UNKNOWN (by entering SET
  4897. TERM/UNKNOWN) and  defining  the  logical  name  ELVIS_TERM.
  4898. Whatever  ELVIS_TERM translates to, however, will have to be
  4899. included in tinytcap.c.  Note that the upper/lowercase  dis-
  4900. tinctions are significant, and that DCL will upshift charac-
  4901. ters that are not quoted strings, so enter DEFINE ELVIS_TERM
  4902. "hp2621a".   As distributed, it would probably not be a good
  4903. idea to have more than the standard terminals in  tinytcap.c
  4904. (else  it  wouldn't  be  tiny, would it?).  Changes here, of
  4905. course, would require a recompilation to take effect.
  4906.  
  4907.      If you have a version  of  the  "termcap"  library  and
  4908. database  on  your  system,  then  you  may  wish to replace
  4909. tinytcap with the real termcap.
  4910.  
  4911. 13.11.  AmigaDOS
  4912.  
  4913.      Mike Rieser and Dale Rahn ported Elvis to AmigaDOS.
  4914.  
  4915.      The port was done using  Manx  Aztec  C  version  5.2b.
  4916. Elvis  uses about as much space as it can and still be small
  4917. code and data.  Elvis should also compile under DICE, though
  4918. there  may  be  a little trouble with signed versus unsigned
  4919. chars.
  4920.  
  4921.      The port has been done so  the  same  binary  will  run
  4922. under both versions of AmigaDOS.  Under AmigaDOS 2.04, Elvis
  4923. supports all the  documented  features.   It  also  uses  an
  4924. external program ref to do tag lookup.  So, the accompanying
  4925. programs: ref and ctags  are  recommended.   Under  AmigaDOS
  4926. 1.2/1.3 Elvis works, buts lacks the more advanced features.
  4927.  
  4928.      For the port to AmigaDOS 2.04, we tried to use as  many
  4929. Native  AmigaDOS  calls  as  we could.  This should increase
  4930. Elvis's chances at  being  compiled  with  other  compilers.
  4931. DICE  seems  to have a different default char type.  You may
  4932. need to use the UCHAR() macro in tio.c.  To test it, try the
  4933. :map command; if it looks right, things are cool.
  4934.  
  4935.      For the port to AmigaDOS 1.3, we tried to make sure the
  4936. program  was  at  least  usable.  Many features are missing,
  4937. most notably running commands in subshells.  Also,  what  we
  4938. could  get working, we used Aztec functions to support them,
  4939. so this part is little more compiler dependent.
  4940.  
  4941.  
  4942.  
  4943.  
  4944.                      November 30, 1993
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950. 13-8                      VERSIONS                      13-8
  4951.  
  4952.  
  4953.      Aztec is compatible with the SAS  libcall  #pragma.   I
  4954. personally  prefer  using the includes that come from Commo-
  4955. dore over the ones supplied with Aztec, but for people  with
  4956. a straight Aztec installation, I went with the default names
  4957. for the Aztec pragmas.
  4958.  
  4959.      One include you'll need is <sys/types.h>.  It's a  com-
  4960. mon  include  when  porting software just make yourself one.
  4961. It's a two line file that saves a lot of  hassle  especially
  4962. in  the  Elvis  source.   So,  make  a  directory where your
  4963. includes are located called `sys' and in a file  below  that
  4964. type:
  4965.         /* sys/types.h */
  4966.         #include <exec/types.h>
  4967.  
  4968.      When setting environment  variables  (either  local  or
  4969. global)  for  variables  that specify a directory, make sure
  4970. the variable ends in `:' or `/'.  This saved from having  to
  4971. change  much  of the way Elvis works.  The default temporary
  4972. directory (if TEMP and TMP aren't specified) is  "T:".   The
  4973. default  if  HOME directory (if no HOME environment variable
  4974. is set) is "S:".
  4975.  
  4976.      To avoid conflict with other uses, Elvis uses  elvis.rc
  4977. instead of .exrc or where it looks for macros.
  4978.  
  4979. 13.12.  OS/2 2.x
  4980.  
  4981.      Elvis was ported to OS/2 by Kai Uwe Rommel.  Greg  Roe-
  4982. lofs  fixed  some  generic bugs and added various tweaks and
  4983. VIO features not supported by OS/2's ANSI emulation.   Elvis
  4984. was  ported  using  the  emx  port  of  the  GNU  C compiler
  4985. ("emx+gcc"); other OS/2 compilers (including the gcc/2 port)
  4986. will probably not work due to their lack of termcap support.
  4987. If you use emx 0.8f or earlier, you will need to change  the
  4988. -Zmtd  option  to -Zmt in Makefile.mix, as noted in the com-
  4989. ment there.
  4990.  
  4991.      The port is derived from the MS-DOS port,  so  most  of
  4992. the  MS-DOS  comments should still be valid.  In particular,
  4993. the default pathnames for the temp directory  and  preserva-
  4994. tion  directory  are  the  same,  and  wildcard.exe is used.
  4995. (emx's _wildcard() function is  [optionally]  used  in  most
  4996. places, but ex.c still calls the "standard" wildcard() func-
  4997. tion.)
  4998.  
  4999.      Note that the executables are  dynamically  linked,  so
  5000. you'll  need  EMX.DLL and EMXLIBC.DLL somewhere in your LIB-
  5001. PATH.  These are included  with  executables-only  distribu-
  5002. tions  and,  of course, with emx itself.  You'll also need a
  5003. termcap.dat file in a location pointed  at  by  the  TERMCAP
  5004. variable;  again,  one  is  supplied.  Set the TERM variable
  5005. equal to one of the listed termcap entries such as "ansi" or
  5006. "pcbios".
  5007.  
  5008.  
  5009.  
  5010.                      November 30, 1993
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016. 13-9                      VERSIONS                      13-9
  5017.  
  5018.  
  5019.      Finally, note that the VIO features mentioned above are
  5020. not  enabled  by  default.   Without  them,  Elvis uses only
  5021. termcap codes for screen updates and can therefore  be  used
  5022. remotely  (e.g., in a telnet session).  If you're working at
  5023. the OS/2 system console, however, the VIO  features  can  be
  5024. enabled via a special Elvis variable, "viomode" (abbreviated
  5025. "vm").  Although it can be used interactively to enable most
  5026. of  the  new features (smooth backscrolling, cursor shape in
  5027. insert  mode,  shorter  beeps),  enabling  both  the   auto-
  5028. detection  of  ANSI mode (plus setting it, if necessary) and
  5029. the restoration of screen colors requires the  EXINIT  vari-
  5030. able  to  be  set.   (By  the  time Elvis is running and the
  5031. interactive command is given, it's too late  for  such  ini-
  5032. tializations.)  For example, add "set EXINIT=set viomode" to
  5033. your config.sys file; this will take effect at the next OS/2
  5034. reboot.
  5035.  
  5036. 13.13.  Other Systems
  5037.  
  5038.      For SunOS and Solaris 1.x, use the  BSD  settings;  for
  5039. Solaris  2.x,  use  the  SysV settings.  Earlier versions of
  5040. Elvis didn't link correctly due to a quirk in Sun's  version
  5041. of  the  "make"  utility,  but  this  version of Elvis has a
  5042. work-around for that quirk so you should have no trouble  at
  5043. all.
  5044.  
  5045.      For AIX, use the SysV settings  in  Makefile.mix,  with
  5046. the changes suggested by comments there.
  5047.  
  5048.      For other UNIXoid systems, I suggest you start with the
  5049. Minix-68k settings and then grow from that.  Minix is a nice
  5050. starting point because it is a  clone  of  Version  7  UNIX,
  5051. which  was  the  last  common  ancestor of BSD UNIX and SysV
  5052. UNIX.  Any operating system which claims any  UNIX  compati-
  5053. bility whatsoever will therefore support V7/Minix code.  You
  5054. may need to fiddle with #include  directives  or  something,
  5055. though.   Minix-68k is a better starting point than Minix-PC
  5056. because the PC compiler has some severe quirks.
  5057.  
  5058.      If you're thinking of porting Elvis  to  some  non-UNIX
  5059. system, I suggest you begin by studying the "INTERNALS" sec-
  5060. tion of this manual.
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068.  
  5069.  
  5070.  
  5071.  
  5072.  
  5073.  
  5074.  
  5075.  
  5076.                      November 30, 1993
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085. 14.  QUESTIONS & ANSWERS
  5086.  
  5087.  
  5088. 1)  How can I make Elvis run faster under DOS?
  5089.  
  5090.        There are several things you can do.  The first thing
  5091.        to  do is get a good screen driver such as NANSI.SYS.
  5092.        This can speed up screen redrawing by as  much  as  a
  5093.        factor of eight!  The DOS-specific part of section 12
  5094.        tells you how to do this.
  5095.  
  5096.        You might also consider  reducing  the  size  of  the
  5097.        blocks  that  Elvis  uses.   You'll need to recompile
  5098.        Elvis to do this.  The default BLKSIZE is 2048  bytes
  5099.        for  the  DOS  version of Elvis, which means that for
  5100.        each keystroke that you insert, Elvis must  shift  an
  5101.        average  of  about  1000  bytes.  That's a lot to ask
  5102.        from a little old 5MHz 8088.  A BLKSIZE of 512  bytes
  5103.        might be more appropriate.
  5104.  
  5105.        A "write-back" disk cache can help.  DOS 5.0 and Win-
  5106.        dows 3.0 come with one of these, called SMARTDRV.EXE.
  5107.        I suggest you add "SMARTDRV C+" to your  AUTOEXEC.BAT
  5108.        file.
  5109.  
  5110.        If you're really desperate for more speed, you  might
  5111.        want to make Elvis store its temporary files on a RAM
  5112.        disk.  However, this limits the size of the file  you
  5113.        can  edit,  and it eliminates any chance you may have
  5114.        had to recover your work after  a  power  failure  or
  5115.        system  crash,  but it might be worth it; you decide.
  5116.        To do this, add ":set dir=R:\" (or whatever your  RAM
  5117.        disk's name is) to the elvis.rc file.
  5118.  
  5119.        Next, consider turning off the "sync"  option.   When
  5120.        the  sync  option  is turned on, Elvis will close the
  5121.        temporary file and reopen it after every  change,  in
  5122.        order  to  force  DOS  to update the file's directory
  5123.        entry.  If you put ":set nosync"  into  the  elvis.rc
  5124.        file,  then  Elvis  will only close the file when you
  5125.        start editing a different text file, or  when  you're
  5126.        exiting Elvis.  Consequently, there is no chance that
  5127.        you'll be able to recover your changes after a  power
  5128.        failure... so if you're going to this, then you might
  5129.        as well store the temp files on the RAM disk, too.
  5130.  
  5131.  
  5132. 2)  Why isn't Elvis reading my .exrc (or ELVIS.RC) file?
  5133.  
  5134.        For security reasons, Elvis doesn't normally look for
  5135.        a  .exrc  file  in  the  current  directory.  A mean-
  5136.        spirited  person  could  lay  a  trap  by  placing  a
  5137.        dangerous  command  in  a  .exrc  file in some public
  5138.        directory.
  5139.  
  5140.  
  5141.  
  5142.                      November 30, 1993
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148. 14-2                QUESTIONS & ANSWERS                 14-2
  5149.  
  5150.  
  5151.        If you know for a fact that no such person  has  ever
  5152.        used  your  computer, then you can make elvis process
  5153.        the .exrc file from the current directory  by  adding
  5154.        "set exrc" to either your EXINIT environment variable
  5155.        or to the .exrc file in your home directory.
  5156.  
  5157.  
  5158. 3)  What is my home directory?
  5159.  
  5160.        On UNIX systems, each user is given a private  "home"
  5161.        directory.   Among other uses, this is used for stor-
  5162.        ing personal configuration files for use with various
  5163.        programs.   UNIX  stores  the  pathname  of your home
  5164.        directory in an environment variable called "HOME".
  5165.  
  5166.        DOS doesn't have UNIX-style home directories, but  if
  5167.        you  explicitly  set  HOME to the name of some direc-
  5168.        tory, then Elvis will still  look  for  its  ELVIS.RC
  5169.        file  there.   If HOME is unset, then elvis will look
  5170.        for ELVIS.RC in the same  directory  where  ELVIS.EXE
  5171.        was found.
  5172.  
  5173.  
  5174. 4)  Where's the <Esc> key on a DEC keyboard?
  5175.  
  5176.        I don't know.  Maybe the <F11> key?  Maybe Control-3?
  5177.        You  could  always use ":map!" to make some other key
  5178.        act like the <Esc>  key.   If  all  else  fails,  try
  5179.        <Control-[>.
  5180.  
  5181.  
  5182. 5)  Is there a way to show which keys do what?
  5183.  
  5184.        Yes.  The command ":map" will show what each key does
  5185.        in  command  mode,  and  ":map!" (with an exclamation
  5186.        mark) shows what each key does in input mode.
  5187.  
  5188.        The table is divided into three  columns:  the  key's
  5189.        label,  the characters that it sends, and the charac-
  5190.        ters that Elvis pretends you typed.
  5191.  
  5192.  
  5193. 6)  How can I make Elvis display long lines  like  the  real
  5194.     vi?
  5195.  
  5196.        You can't yet.  The next version of Elvis should sup-
  5197.        port this, though.
  5198.  
  5199.  
  5200. 7)  I can't recover my text [under  MS-DOS  or  Atari  TOS].
  5201.     According  to  the directory listing, the temporary file
  5202.     is 0 bytes long.  What went wrong?
  5203.  
  5204.        MS-DOS and TOS only update a file's  directory  entry
  5205.  
  5206.  
  5207.  
  5208.                      November 30, 1993
  5209.  
  5210.  
  5211.  
  5212.  
  5213.  
  5214. 14-3                QUESTIONS & ANSWERS                 14-3
  5215.  
  5216.  
  5217.        when the file is closed.  If the system crashes while
  5218.        the file is still open, then  the  file's  length  is
  5219.        stored  as  0  bytes.  The ":set sync" option is sup-
  5220.        posed to prevent this; you probably turned it off  in
  5221.        the interest of speed, right?
  5222.  
  5223.        Under MS-DOS [I don't know  about  TOS],  you  should
  5224.        delete   the  empty  temporary  file,  and  then  run
  5225.        CHKDSK/F.  This might find the data that belonged  in
  5226.        the  empty  file,  and  place it in a new file with a
  5227.        name like "000001.CHK" -- something like  that.   You
  5228.        can  then try to extract the text from that temporary
  5229.        file by giving the command "elvprsv  -R  000001.chk".
  5230.        If you're lucky, then this might recover your text.
  5231.  
  5232.  
  5233. 8)  What is the most current version of Elvis?
  5234.  
  5235.        Each version of Elvis that is released to the  public
  5236.        has  a  version  number  of  the  form  "number point
  5237.        number".  As I write this, the most  current  version
  5238.        of Elvis is 1.8c-beta.
  5239.  
  5240.        The intermediate steps between one  release  and  the
  5241.        next are labeled with the next version number, with a
  5242.        letter  appended.   For  example,   after   1.4   was
  5243.        released,  I started working on 1.5a.  I am currently
  5244.        working on 2.0a.  When Elvis reaches a stable  state,
  5245.        I'll call it 2.0 and release it.
  5246.  
  5247.        Sometimes a beta-test version of Elvis will be avail-
  5248.        able  via  anonymous FTP from m2xenix.psg.com, in the
  5249.        directory "pub/elvis/beta".
  5250.  
  5251.  
  5252. 9)  I only got executables, but now I want the source  code.
  5253.     Where can I get it?
  5254.  
  5255.        If you have access to the Internet, then  you  should
  5256.        be  able  to fetch it from one of the public archives
  5257.        such  as  plains.nodak.edu.   It  is  accessible  via
  5258.        anonymous   FTP,   or   via  an  email  server  named
  5259.        "archive-server@plains.nodak.edu".  Elvis is  located
  5260.        in the directory "/pub/Minix/all.contrib".
  5261.  
  5262.        It is also available from  the  C  Users'  Group,  in
  5263.        volume #365.  As I write this, they are asking $4 per
  5264.        disk plus $3.50  per  order  in  the  US,  and  elvis
  5265.        requires  three  disks;  this  is  subject to change.
  5266.        Their phone  number  is  (913)  841-1631,  and  their
  5267.        address is:
  5268.  
  5269.  
  5270.                                 The C Users' Group
  5271.  
  5272.  
  5273.  
  5274.                      November 30, 1993
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280. 14-4                QUESTIONS & ANSWERS                 14-4
  5281.  
  5282.  
  5283.                                 1601 W. 23rd Street, #200
  5284.                                 Lawrence  KS  66046-2743
  5285.  
  5286.  
  5287.  
  5288. 10) Is this shareware, or public domain, or what?
  5289.  
  5290.        It is not public domain; it  is  copyrighted  by  me,
  5291.        Steve  Kirkendall.   However, this particular version
  5292.        is freely redistributable, in either source  form  or
  5293.        executable  form.   (I  would  prefer  that  you give
  5294.        copies away for free, complete with the  full  source
  5295.        code... but I'm not going to force you.)
  5296.  
  5297.        It is not shareware; you aren't expected to  send  me
  5298.        anything.  You can use it without guilt.
  5299.  
  5300.        It is not  "copylefted."  I  hold  a  copyright,  but
  5301.        currently  I have not added any of the usual restric-
  5302.        tions that you would find on copylefted software.  If
  5303.        people  start doing really obnoxious things to Elvis,
  5304.        then I will start adding restrictions  to  subsequent
  5305.        versions,  but  earlier  versions  won't be affected.
  5306.        (So far, everybody has been pretty good about this so
  5307.        no restrictions have been necessary.)
  5308.  
  5309.  
  5310. 11) Can I reuse parts of your source code?
  5311.  
  5312.        Yes.  Please be careful, though, to  make  sure  that
  5313.        the  code  really is mine.  Some of the code was con-
  5314.        tributed by  other  people,  and  I  don't  have  the
  5315.        authority  to  give  you  permission  to use it.  The
  5316.        author's name can be  found  near  the  top  of  each
  5317.        source  file.  If it says "Steve Kirkendall" then you
  5318.        may use  it;  otherwise,  you'd  better  contact  the
  5319.        author first.
  5320.  
  5321.        Please don't remove my name from the source code.  If
  5322.        you  modify  the  source,  please make a note of that
  5323.        fact in a comment near the top of  the  source  code.
  5324.        And, finally, please mention my name in your documen-
  5325.        tation.
  5326.  
  5327.  
  5328. 12) Can Elvis work with non-ASCII files?
  5329.  
  5330.        Elvis is 8-bit clean.  This  means  that  Elvis  will
  5331.        allow  you to edit files that use a European extended
  5332.        ASCII character set.  However, some terminals are not
  5333.        8-bit  clean;  they  treat  characters  in  the range
  5334.        0x80-0x9f as control characters.  Elvis  expects  all
  5335.        characters   above  0x7f  to  be  treated  as  normal
  5336.        displayable characters, so on these  terminals  Elvis
  5337.  
  5338.  
  5339.  
  5340.                      November 30, 1993
  5341.  
  5342.  
  5343.  
  5344.  
  5345.  
  5346. 14-5                QUESTIONS & ANSWERS                 14-5
  5347.  
  5348.  
  5349.        may produce a scrambled display.
  5350.  
  5351.        Elvis can't edit binary files because it can't handle
  5352.        the NUL character, and because of line-length limita-
  5353.        tions.
  5354.  
  5355.        Elvis has also modified to work with 16-bit character
  5356.        sets,  but that modification is not part of the stan-
  5357.        dard    Elvis    distribution.     Yongguang    Zhang
  5358.        (ygz@cs.purdue.edu)  has created a Chinese version of
  5359.        Elvis that uses  16-bit  characters  and  runs  under
  5360.        cxterm  (Chinese X-term) on X-windows systems.  Juni-
  5361.        chiro Itoh (itojun@foretune.co.jp) has modified Elvis
  5362.        to edit Japanese text under MS-DOS.
  5363.  
  5364.  
  5365.  
  5366.  
  5367.  
  5368.  
  5369.  
  5370.  
  5371.  
  5372.  
  5373.  
  5374.  
  5375.  
  5376.  
  5377.  
  5378.  
  5379.  
  5380.  
  5381.  
  5382.  
  5383.  
  5384.  
  5385.  
  5386.  
  5387.  
  5388.  
  5389.  
  5390.  
  5391.  
  5392.  
  5393.  
  5394.  
  5395.  
  5396.  
  5397.  
  5398.  
  5399.  
  5400.  
  5401.  
  5402.  
  5403.  
  5404.  
  5405.  
  5406.                      November 30, 1993
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416. NAME
  5417.      ctags - Generates "tags" and (optionally) "refs" files
  5418.  
  5419. SYNOPSIS
  5420.      ctags [-stvraT] filesnames...
  5421.  
  5422. DESCRIPTION
  5423.      ctags generates the "tags" and "refs" files from a group  of
  5424.      C  source  files.   The "tags" file is used by Elvis' ":tag"
  5425.      command, control-] command, and -t option.  The "refs"  file
  5426.      is sometimes used by the ref(1) program.
  5427.  
  5428.      Each C source file is scanned  for  #define  statements  and
  5429.      global function definitions.  The name of the macro or func-
  5430.      tion becomes the name of a tag.  For each  tag,  a  line  is
  5431.      added to the "tags" file which contains:
  5432.                  - the name of the tag
  5433.                  - a tab character
  5434.                  - the name of the file containing the tag
  5435.                  - a tab character
  5436.                  - a way to find the particular line within the file.
  5437.  
  5438.      The filenames list will typically be  the  names  of  all  C
  5439.      source files in the current directory, like this:
  5440.           $ ctags -stv *.[ch]
  5441.  
  5442. OPTIONS
  5443.      -t   Include typedefs.  A tag will  be  generated  for  each
  5444.           user-defined  type.   Also  tags  will be generated for
  5445.           struct and enum names.  Types are considered to be glo-
  5446.           bal if they are defined in a header file, and static if
  5447.           they are defined in a C source file.
  5448.  
  5449.      -v   Include variable declarations.  A tag will be generated
  5450.           for  each  variable, except for those that are declared
  5451.           inside the body of a function.
  5452.  
  5453.      -s   Include static tags.  Ctags will  normally  put  global
  5454.           tags in the "tags" file, and silently ignore the static
  5455.           tags.  This flag causes both global and static tags  to
  5456.           be  added.   The  name  of a static tag is generated by
  5457.           prefixing the name of the declared item with  the  name
  5458.           of  the  file  where  it  is  defined,  with a colon in
  5459.           between.  For  example,  "static  foo(){}"  in  "bar.c"
  5460.           results in a tag named "bar.c:foo".
  5461.  
  5462.      -r   This causes ctags to generate both "tags"  and  "refs".
  5463.           Without -r, it would only generate "tags".
  5464.  
  5465.      -a   Append to "tags", and maybe  "refs".   Normally,  ctags
  5466.           overwrites  these  files each time it is invoked.  This
  5467.           flag is useful when you  have  to  many  files  in  the
  5468.  
  5469.  
  5470.  
  5471. Sun Release 4.1           Last change:                          1
  5472.  
  5473.  
  5474.  
  5475.  
  5476.  
  5477.  
  5478. CTAGS(1)                 USER COMMANDS                   CTAGS(1)
  5479.  
  5480.  
  5481.  
  5482.           current  directory  for  you  to  list them on a single
  5483.           command-line; it allows  you  to  split  the  arguments
  5484.           among several invocations.
  5485.  
  5486.      -T   This flag isn't available on all systems.  UNIX has it,
  5487.           but most others don't.  The -T flag prevents ctags from
  5488.           generating a "tags" file.  This is useful when you want
  5489.           to generate a "refs" without changing "tags".
  5490.  
  5491. FILES
  5492.      tags A cross-reference that lists each tag name, the name of
  5493.           the source file that contains it, and a way to locate a
  5494.           particular line in the source file.
  5495.  
  5496.      refs The "refs" file contains the definitions for  each  tag
  5497.           in  the  "tags"  file, and very little else.  This file
  5498.           can be useful, for example, when licensing restrictions
  5499.           prevent you from making the source code to the standard
  5500.           C library readable by everybody, but you  still  every-
  5501.           body to know what arguments the library functions need.
  5502.  
  5503. BUGS
  5504.      ctags is sensitive to indenting  and  line  breaks.   Conse-
  5505.      quently,  it  might  not  discover all of the tags in a file
  5506.      that is formatted in an unusual way.
  5507.  
  5508. SEE ALSO
  5509.      elvis(1), refs(1)
  5510.  
  5511. AUTHOR
  5512.      Steve Kirkendall
  5513.      kirkenda@cs.pdx.edu
  5514.  
  5515.  
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.  
  5522.  
  5523.  
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529.  
  5530.  
  5531.  
  5532.  
  5533.  
  5534.  
  5535.  
  5536.  
  5537. Sun Release 4.1           Last change:                          2
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548. NAME
  5549.      elvis, ex, vi, view, input - The editor
  5550.  
  5551. SYNOPSIS
  5552.      elvis [flags] [+cmd] [files...]
  5553.  
  5554. DESCRIPTION
  5555.      Elvis is a text editor which emulates vi/ex.
  5556.  
  5557.      On systems which pass the program name as an argument,  such
  5558.      as  Unix  and  Minix,  you  may also install elvis under the
  5559.      names "ex", "vi", "view", and "input".   These  extra  names
  5560.      would  normally  be  links to elvis; see the "ln" shell com-
  5561.      mand.
  5562.  
  5563.      When elvis is invoked as "vi", it behaves exactly as  though
  5564.      it  was invoked as "elvis".  However, if you invoke elvis as
  5565.      "view", then the readonly option is set as  though  you  had
  5566.      given  it  the "-R" flag.  If you invoke elvis as "ex", then
  5567.      elvis will start up in the colon command mode instead of the
  5568.      visual  command  mode,  as  though you had given it the "-e"
  5569.      flag.  If you invoke elvis as "input" or "edit", then  elvis
  5570.      will  start  up  in  input mode, as though the "-i" flag was
  5571.      given.
  5572.  
  5573. OPTIONS
  5574.      -r   To the real vi, this flag means that  a  previous  edit
  5575.           should  be  recovered.   Elvis,  though, has a separate
  5576.           program, called elvrec(1), for recovering files.   When
  5577.           you  invoke  elvis  with -r, elvis will tell you to run
  5578.           elvrec.
  5579.  
  5580.      -R   This sets the "readonly" option, so you won't  acciden-
  5581.           tally overwrite a file.
  5582.  
  5583.      -t tag
  5584.           This causes elvis to start editing at the given tag.
  5585.  
  5586.      -m [file]
  5587.           Elvis will search through file for something that looks
  5588.           like  an  error  message from a compiler.  It will then
  5589.           begin editing the source file that  caused  the  error,
  5590.           with the cursor sitting on the line where the error was
  5591.           detected.  If you don't explicitly name  a  file,  then
  5592.           "errlist" is assumed.
  5593.  
  5594.      -e   Elvis will start up in colon command mode.
  5595.  
  5596.      -v   Elvis will start up in visual command mode.
  5597.  
  5598.      -i   Elvis will start up in input mode.
  5599.  
  5600.  
  5601.  
  5602.  
  5603. Sun Release 4.1           Last change:                          1
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610. ELVIS(1)                 USER COMMANDS                   ELVIS(1)
  5611.  
  5612.  
  5613.  
  5614.      -w winsize
  5615.           Sets the "window" option's value to winsize.
  5616.  
  5617.      +command or -c command
  5618.           If you use the +command parameter, then after the first
  5619.           file is loaded command is executed as an EX command.  A
  5620.           typical example would be "elvis +237 foo", which  would
  5621.           cause elvis to start editing foo and then move directly
  5622.           to line 237.  The "-c command" variant  was  added  for
  5623.           UNIX SysV compatibility.
  5624.  
  5625. FILES
  5626.      /tmp/elv*
  5627.           During editing, elvis stores text in a temporary  file.
  5628.           For  UNIX, this file will usually be stored in the /tmp
  5629.           directory, and  the  first  three  characters  will  be
  5630.           "elv".   For  other systems, the temporary files may be
  5631.           stored someplace else; see the version-specific section
  5632.           of the documentation.
  5633.  
  5634.      tags This is the database used by the :tags command and  the
  5635.           -t  option.  It is usually created by the ctags(1) pro-
  5636.           gram.
  5637.  
  5638.      .exrc or elvis.rc
  5639.           On UNIX-like systems, a file  called  ".exrc"  in  your
  5640.           home  directory is executed as a series of ex commands.
  5641.           A file by the same name may be executed in the  current
  5642.           directory,  too.   On non-UNIX systems, ".exrc" is usu-
  5643.           ally an invalid file name;  there,  the  initialization
  5644.           file is called "elvis.rc" instead.
  5645.  
  5646. ENVIRONMENT
  5647.      TERM This is the  name  of  your  terminal's  entry  in  the
  5648.           termcap or terminfo database.  The list of legal values
  5649.           varies from one system to another.
  5650.  
  5651.      TERMCAP
  5652.           Optional.  If your system uses termcap, and the TERMCAP
  5653.           variable is unset, then
  5654.            will   read   your    terminal's    definition    from
  5655.           /etc/termcap.   If  TERMCAP is set to the full pathname
  5656.           of a file (starting with a '/') then  will look in  the
  5657.           named  file instead of /etc/termcap.  If TERMCAP is set
  5658.           to a value which doesn't start with  a  '/',  then  its
  5659.           value  is assumed to be the full termcap entry for your
  5660.           terminal.
  5661.  
  5662.      TERMINFO
  5663.           Optional.  If your system uses terminfo, and  the  TER-
  5664.           MINFO variable is unset, then
  5665.            will read your terminal's definition from the database
  5666.  
  5667.  
  5668.  
  5669. Sun Release 4.1           Last change:                          2
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676. ELVIS(1)                 USER COMMANDS                   ELVIS(1)
  5677.  
  5678.  
  5679.  
  5680.           in the /usr/lib/terminfo database.  If TERMINFO is set,
  5681.           then its value is used as  the  database  name  to  use
  5682.           instead of /usr/lib/terminfo.
  5683.  
  5684.      LINES, COLUMNS
  5685.           Optional.  These variables, if set, will  override  the
  5686.           screen  size  values  given in the termcap/terminfo for
  5687.           your terminal.  On windowing systems such  as  X,   has
  5688.           other  ways  of  determining  the  screen  size, so you
  5689.           should probably leave these variables unset.
  5690.  
  5691.      EXINIT
  5692.           Optional.  This variable can  hold  EX  commands  which
  5693.           will be executed before any .exrc files.
  5694.  
  5695.      SHELL
  5696.           Optional.  The SHELL variable sets  the  default  value
  5697.           for  the  "shell"  option, which determines which shell
  5698.           program is used to perform wildcard expansion  in  file
  5699.           names,  and  also  which  is used to execute filters or
  5700.           external programs.  The default value on  UNIX  systems
  5701.           is "/bin/sh".
  5702.  
  5703.           Note: Under MS-DOS, this  variable  is  called  COMSPEC
  5704.           instead of SHELL.
  5705.  
  5706.      HOME This variable should be set to the name  of  your  home
  5707.           directory.
  5708.            looks for its initialization file there;  if  HOME  is
  5709.           unset  then  the  initialization  file will not be exe-
  5710.           cuted.
  5711.  
  5712.      TAGPATH
  5713.           Optional.  This variable is used by the "ref"  program,
  5714.           which  is  invoked  by the shift-K, control-], and :tag
  5715.           commands.  See "ref" for more information.
  5716.  
  5717.      TMP, TEMP
  5718.           These optional environment variables are only  used  in
  5719.           non-UNIX  versions  of  .   They  allow you to supply a
  5720.           directory name to be used for storing temporary files.
  5721.  
  5722. SEE ALSO
  5723.      ctags(1), ref(1), virec(1)
  5724.  
  5725.      Elvis - A Clone of Vi/Ex, the complete elvis documentation.
  5726.  
  5727. BUGS
  5728.      There is no LISP support.  Certain other features are  miss-
  5729.      ing, too.
  5730.  
  5731.  
  5732.  
  5733.  
  5734.  
  5735. Sun Release 4.1           Last change:                          3
  5736.  
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742. ELVIS(1)                 USER COMMANDS                   ELVIS(1)
  5743.  
  5744.  
  5745.  
  5746.      Auto-indent mode is not quite compatible with the  real  vi.
  5747.      Among  other  things,  0^D  and  ^^D don't do what you might
  5748.      expect.
  5749.  
  5750.      Long lines are displayed differently.   The  real  vi  wraps
  5751.      long  lines  onto  multiple  rows  of  the screen, but elvis
  5752.      scrolls sideways.
  5753.  
  5754. AUTHOR
  5755.      Steve Kirkendall
  5756.      kirkenda@cs.pdx.edu
  5757.  
  5758.      Many other people have  worked  to  port  elvis  to  various
  5759.      operating  systems.   To  see  who  deserves credit, run the
  5760.      :version command from within elvis, or look in  the  system-
  5761.      specific section of the complete documentation.
  5762.  
  5763.  
  5764.  
  5765.  
  5766.  
  5767.  
  5768.  
  5769.  
  5770.  
  5771.  
  5772.  
  5773.  
  5774.  
  5775.  
  5776.  
  5777.  
  5778.  
  5779.  
  5780.  
  5781.  
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.  
  5801. Sun Release 4.1           Last change:                          4
  5802.  
  5803.  
  5804.  
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812. NAME
  5813.      elvprsv - Preserve the the modified version of a file  after
  5814.      a crash.
  5815.  
  5816. SYNOPSIS
  5817.      elvprsv ["-why elvis died"] /tmp/filename...
  5818.      elvprsv -R /tmp/filename...
  5819.  
  5820. DESCRIPTION
  5821.      elvprsv preserves your edited text after  elvis  dies.   The
  5822.      text can be recovered later, via the elvprsv program.
  5823.  
  5824.      For UNIX-like systems, you should never  need  to  run  this
  5825.      program from the command line.  It is run automatically when
  5826.      elvis is about to die, and it should be  run  (via  /etc/rc)
  5827.      when the computer is booted.  THAT'S ALL!
  5828.  
  5829.      For non-UNIX systems such as MS-DOS or VMS, you  can  either
  5830.      use  elvprsv  the same way as under UNIX systems (by running
  5831.      it  from  your  AUTOEXEC.BAT  file),  or  you  can  run   it
  5832.      separately  with  the  "-R" flag to recover the files in one
  5833.      step.
  5834.  
  5835.      If you're editing a file when elvis dies (due to a bug, sys-
  5836.      tem  crash,  power failure, etc.) then elvprsv will preserve
  5837.      the most recent version of your text.  The preserved text is
  5838.      stored  in  a  special directory; it does NOT overwrite your
  5839.      text file automatically.   (If  the  preservation  directory
  5840.      hasn't  been set up correctly, then elvprsv will simply send
  5841.      you a mail message descrining how to manually run elvprsv.)
  5842.  
  5843.      elvprsv will send mail to any user whose work it  preserves,
  5844.      if your operating system normally supports mail.
  5845.  
  5846. FILES
  5847.      /tmp/elv*
  5848.           The temporary file that elvis was using when it died.
  5849.  
  5850.      /usr/preserve/p*
  5851.           The text that is preserved by elvprsv.
  5852.  
  5853.      /usr/preserve/Index
  5854.           A text file which lists  the  names  of  all  preserved
  5855.           files,  and  the  names  of  the /usr/preserve/p* files
  5856.           which contain their preserved text.
  5857.  
  5858. BUGS
  5859.      Due to the permissions on the  /usr/preserve  directory,  on
  5860.      UNIX  systems  elvprsv  must  be  run as superuser.  This is
  5861.      accomplished by making the elvprsv executable  be  owned  by
  5862.      "root" and turning on its "set user id" bit.
  5863.  
  5864.  
  5865.  
  5866.  
  5867. Sun Release 4.1           Last change:                          1
  5868.  
  5869.  
  5870.  
  5871.  
  5872.  
  5873.  
  5874. ELVPRSV(1)               USER COMMANDS                 ELVPRSV(1)
  5875.  
  5876.  
  5877.  
  5878.      If you're editing a nameless buffer when  elvis  dies,  then
  5879.      elvprsv will pretend that the file was named "foo".
  5880.  
  5881. AUTHOR
  5882.      Steve Kirkendall
  5883.      kirkenda@cs.pdx.edu
  5884.  
  5885.  
  5886.  
  5887.  
  5888.  
  5889.  
  5890.  
  5891.  
  5892.  
  5893.  
  5894.  
  5895.  
  5896.  
  5897.  
  5898.  
  5899.  
  5900.  
  5901.  
  5902.  
  5903.  
  5904.  
  5905.  
  5906.  
  5907.  
  5908.  
  5909.  
  5910.  
  5911.  
  5912.  
  5913.  
  5914.  
  5915.  
  5916.  
  5917.  
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.  
  5925.  
  5926.  
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933. Sun Release 4.1           Last change:                          2
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944. NAME
  5945.      elvrec - Recover the modified version  of  a  file  after  a
  5946.      crash
  5947.  
  5948. SYNOPSIS
  5949.      elvrec [preservedfile [newfile]]
  5950.  
  5951. DESCRIPTION
  5952.      If you're  editing  a  file  when  elvis  dies,  the  system
  5953.      crashes,  or  power  fails,  the most recent version of your
  5954.      text will be preserved.  The preserved text is stored  in  a
  5955.      special  directory;  it  does  NOT  overwrite your text file
  5956.      automatically.
  5957.  
  5958.      The elvrec program locates the preserved version of a  given
  5959.      file,  and writes it over the top of your text file -- or to
  5960.      a new file, if you prefer.  The  recovered  file  will  have
  5961.      nearly all of your changes.
  5962.  
  5963.      To see a list of all recoverable files, run elvrec  with  no
  5964.      arguments.
  5965.  
  5966.      (Note: if you haven't set up a directory for file  preserva-
  5967.      tion,  then  elvis'  you'll have to manually run the elvprsv
  5968.      program instead of elvrec.)
  5969.  
  5970. FILES
  5971.      /usr/preserve/p*
  5972.           The text that was preserved when elvis died.
  5973.  
  5974.      /usr/preserve/Index
  5975.           A text file which lists  the  names  of  all  preserved
  5976.           files,  and  the  names  of  the /usr/preserve/p* files
  5977.           which contain their preserved text.
  5978.  
  5979. BUGS
  5980.      elvrec is very picky about filenames.  You must tell  it  to
  5981.      recover the file using exactly the same pathname as when you
  5982.      were editing it.  The simplest way to do this is to go  into
  5983.      the  same directory that you were editing, and invoke elvrec
  5984.      with the same filename as elvis.  If that doesn't work, then
  5985.      try  running  elvrec with no arguments, to see exactly which
  5986.      pathname it is using for the desired file.
  5987.  
  5988.      Due to the permissions on the  /usr/preserve  directory,  on
  5989.      UNIX  systems  elvrec  must  be  run  as superuser.  This is
  5990.      accomplished by making the elvrec  executable  be  owned  by
  5991.      "root" and setting its "set user id" bit.
  5992.  
  5993.      If you're editing a nameless buffer when  elvis  dies,  then
  5994.      elvrec will pretend that the file was named "foo".
  5995.  
  5996.  
  5997.  
  5998.  
  5999. Sun Release 4.1           Last change:                          1
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006. ELVREC(1)                USER COMMANDS                  ELVREC(1)
  6007.  
  6008.  
  6009.  
  6010. AUTHOR
  6011.      Steve Kirkendall
  6012.      kirkenda@cs.pdx.edu
  6013.  
  6014.  
  6015.  
  6016.  
  6017.  
  6018.  
  6019.  
  6020.  
  6021.  
  6022.  
  6023.  
  6024.  
  6025.  
  6026.  
  6027.  
  6028.  
  6029.  
  6030.  
  6031.  
  6032.  
  6033.  
  6034.  
  6035.  
  6036.  
  6037.  
  6038.  
  6039.  
  6040.  
  6041.  
  6042.  
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065. Sun Release 4.1           Last change:                          2
  6066.  
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076. NAME
  6077.      fmt - adjust line-length for paragraphs of text
  6078.  
  6079. SYNOPSIS
  6080.      fmt [-width] [files]...
  6081.  
  6082. DESCRIPTION
  6083.      fmt is a simple text formatter.  It inserts or deletes  new-
  6084.      lines,  as  necessary,  to  make all lines in a paragraph be
  6085.      approximately the same width.  It preserves indentation  and
  6086.      word spacing.
  6087.  
  6088.      The default line width is 72 characters.  You  can  override
  6089.      this  with  the -width flag.  If you don't name any files on
  6090.      the command line, then fmt will read from stdin.
  6091.  
  6092.      It is typically used from  within  vi  to  adjust  the  line
  6093.      breaks  in  a single paragraph.  To do this, move the cursor
  6094.      to the top of the paragraph, type "!}fmt", and hit <Return>.
  6095.  
  6096. AUTHOR
  6097.      Steve Kirkendall
  6098.      kirkenda@cs.pdx.edu
  6099.  
  6100.  
  6101.  
  6102.  
  6103.  
  6104.  
  6105.  
  6106.  
  6107.  
  6108.  
  6109.  
  6110.  
  6111.  
  6112.  
  6113.  
  6114.  
  6115.  
  6116.  
  6117.  
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131. Sun Release 4.1           Last change:                          1
  6132.  
  6133.  
  6134.  
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142. NAME
  6143.      ref - Display a C function header
  6144.  
  6145. SYNOPSIS
  6146.      ref [-t] [-c class]... [-f file]... tag
  6147.  
  6148. DESCRIPTION
  6149.      ref quickly locates and displays the header of  a  function.
  6150.      To  do  this, ref looks in the "tags" file for the line that
  6151.      describes the function, and then scans the source  file  for
  6152.      the  function.  When it locates the function, it displays an
  6153.      introductory comment  (if  there  is  one),  the  function's
  6154.      declaration, and the declarations of all arguments.
  6155.  
  6156. SEARCH METHOD
  6157.      ref uses a fairly sophisticated tag look-up  algorithm.   If
  6158.      you  supply  a  filename via -f file, then elvis first scans
  6159.      the tags file for a static tag from that file.  This  search
  6160.      is limited to the tags file in the current directory.
  6161.  
  6162.      If you supply a classname via -c class, then elvis  searches
  6163.      for  a  tag  from that class.  This search is not limited to
  6164.      the current directory; You can supply a list of  directories
  6165.      in  the  environment  variable  TAGPATH, and ref will search
  6166.      through the "tags" file in each directory until it  finds  a
  6167.      tag in the desired class.
  6168.  
  6169.      If that fails, ref will then try to look up an ordinary glo-
  6170.      bal  tag.   This search checks all of the directories listed
  6171.      in TAGPATH, too.
  6172.  
  6173.      If you've given the -t flag, then ref will simply output the
  6174.      tag  line that it found, and then exit.  Without -t, though,
  6175.      ref will search for the tag line.  It will try to  open  the
  6176.      source  file,  which  should be in the same directory as the
  6177.      tags file where the tag was discovered.  If the source  file
  6178.      doesn't exist, or is unreadable, then ref will try to open a
  6179.      file called "refs" in that directory.  Either way, ref  will
  6180.      try to locate the tag, and display whatever it finds.
  6181.  
  6182. INTERACTION WITH ELVIS
  6183.      ref is used by elvis' shift-K command.   If  the  cursor  is
  6184.      located on a word such as "splat", in the file "foo.c", then
  6185.      elvis will invoke ref with the command "ref -f foo.c splat".
  6186.  
  6187.      If elvis has been compiled with  the  -DEXTERNAL_TAGS  flag,
  6188.      then  elvis  will  use  ref to scan the tags files.  This is
  6189.      slower than the built-in tag searching, but it allows  elvis
  6190.      to access the more sophisticated tag lookup provided by ref.
  6191.      Other than that,  external  tags  should  act  exactly  like
  6192.      internal tags.
  6193.  
  6194.  
  6195.  
  6196.  
  6197. Sun Release 4.1           Last change:                          1
  6198.  
  6199.  
  6200.  
  6201.  
  6202.  
  6203.  
  6204. REF(1)                   USER COMMANDS                     REF(1)
  6205.  
  6206.  
  6207.  
  6208. OPTIONS
  6209.      -t   Output tag info, instead of the function header.
  6210.  
  6211.      -f file
  6212.           The tag might be a static function in  file.   You  can
  6213.           use  several  -f flags to have ref consider static tags
  6214.           from more than one file.
  6215.  
  6216.      -c class
  6217.           The tag might be a member of class class.  You can  use
  6218.           several  -c  flags  to have ref consider tags from more
  6219.           than one class.
  6220.  
  6221. FILES
  6222.      tags List of function names and their  locations,  generated
  6223.           by ctags.
  6224.  
  6225.      refs Function   headers   extracted   from   source    files
  6226.           (optional).
  6227.  
  6228. ENVIRONMENT
  6229.      TAGPATH
  6230.           List of directories to be searched.   The  elements  in
  6231.           the  list  are  separated by either semicolons (for MS-
  6232.           DOS, Atari TOS, and  AmigaDos),  or  by  colons  (every
  6233.           other  operating  system).   For each operating system,
  6234.           ref has a built-in default which is probably adequate.
  6235.  
  6236. NOTES
  6237.      You might want to generate a "tags" file the directory  that
  6238.      contains the source code for standard C library on your sys-
  6239.      tem.  If licensing restrictions prevent you from making  the
  6240.      library  source  readable  by  everybody,  then you can have
  6241.      ctags generate a "refs" file, and make  "refs"  readable  by
  6242.      everybody.
  6243.  
  6244.      If your system doesn't come with the  library  source  code,
  6245.      then  perhaps  you  can  produce something workable from the
  6246.      lint libraries.
  6247.  
  6248. SEE ALSO
  6249.      elvis(1), ctags(1)
  6250.  
  6251. AUTHOR
  6252.      Steve Kirkendall
  6253.      kirkenda@cs.pdx.edu
  6254.  
  6255.  
  6256.  
  6257.  
  6258.  
  6259.  
  6260.  
  6261.  
  6262.  
  6263. Sun Release 4.1           Last change:                          2
  6264.  
  6265.  
  6266.  
  6267.  
  6268.  
  6269.  
  6270.  
  6271.